cRPG
cRPG => Suggestions Corner => Topic started by: War_Ferret on February 03, 2018, 09:27:45 pm
-
... because nobody knows how much wpf they have after PT, PD and armor penalties are applied.
-
and I feel fine with that tbh.
Better let some exact game mechanics be hidden
-
and I feel fine with that tbh.
Better let some exact game mechanics be hidden
Cause not even the devs know what the real answer is.
-
and I feel fine with that tbh.
Better let some exact game mechanics be hidden
"Read" the code if you wanna know right? ^^
-
There used to be a tampermonkey/greasemonkey script written by San to do just this. Does not appear to work anymore though. Here's what it looks like.
// ==UserScript==
// @name cRPG equipment page info addon
// @description Adds item weight and effective WPF info to inventory page
// @namespace crpg.addons
// @include http://c-rpg.net/index.php?page=equipinvgear*
// @downloadURL https://gist.github.com/smj72/bd81b6fd62ff2b8b5a89/raw/56c10567fa79f0f7673c75ede707f3b0fb6a5768/cRPGInfoAddon.user.js
// @version 0.0.3
// @grant none
// ==/UserScript==
var armorWeight = null;
var effectiveArmorWeight = null;
var effectiveWeightLabel = null;
var weaponWeight = null;
var weightLabel = null;
var totalweightLabel = null;
var e1hWpfElement = null;
var e2hWpfElement = null;
var poleWpfElement = null;
var throwWpfElement = null;
var xbowWpfElement = null;
var archeryWpfElement = null;
var head = null;
var body = null;
var legs = null;
var hand = null;
var item1 = null;
var item2 = null;
var item3 = null;
var item4 = null;
var basePT = null;
var basePD = null;
var baseIF = null;
var baseStr = null;
var base1hWpf = null;
var base2hWpf = null;
var basePoleWpf = null;
var baseThrowWpf = null;
var baseXbowWpf = null;
var baseArcheryWpf = null;
var isChrome = null;
var isFirefox = null;
function UpdateArmorWeight(){
var headItem = null;
var bodyItem = null;
var legsItem = null;
var handItem = null;
if(isFirefox){
headItem = unsafeWindow.getItem(head.options[head.selectedIndex].value);
bodyItem = unsafeWindow.getItem(body.options[body.selectedIndex].value);
legsItem = unsafeWindow.getItem(legs.options[legs.selectedIndex].value);
handItem = unsafeWindow.getItem(hand.options[hand.selectedIndex].value);
}
else{ // Chrome
headItem = window.getItem(head.options[head.selectedIndex].value);
bodyItem = window.getItem(body.options[body.selectedIndex].value);
legsItem = window.getItem(legs.options[legs.selectedIndex].value);
handItem = window.getItem(hand.options[hand.selectedIndex].value);
}
var weight = 0;
effectiveArmorWeight = 0;
armorWeight = 0;
if(headItem != null){
weight += headItem.weight;
effectiveArmorWeight += 2*headItem.weight;}
if(bodyItem != null){
weight += bodyItem.weight;
effectiveArmorWeight += bodyItem.weight;}
if(legsItem != null){
weight += legsItem.weight;
effectiveArmorWeight += legsItem.weight;}
if(handItem != null){
weight += handItem.weight;
effectiveArmorWeight += 6*handItem.weight;}
armorWeight = weight.toFixed(1);
weightLabel.innerHTML = armorWeight
if(armorWeight != null)
{
UpdateItemWeight();
total = (parseFloat(armorWeight) + parseFloat(weaponWeight)).toFixed(1);
totalweightLabel.innerHTML = total;
}
effectiveArmorWeight = Math.pow(Math.max(effectiveArmorWeight - Math.max(Math.max(baseIF * 2, baseStr), 6),0), 1.12).toFixed(1);
effectiveWeightLabel.innerHTML = effectiveArmorWeight;
UpdateWpfTable();
}
function UpdateItemWeight(){
var item1Item = null;
var item2Item = null;
var item3Item = null;
var item4Item = null;
if(isFirefox){
item1Item = unsafeWindow.getItem(item1.options[item1.selectedIndex].value);
item2Item = unsafeWindow.getItem(item2.options[item2.selectedIndex].value);
item3Item = unsafeWindow.getItem(item3.options[item3.selectedIndex].value);
item4Item = unsafeWindow.getItem(item4.options[item4.selectedIndex].value);
}
else{
item1Item = window.getItem(item1.options[item1.selectedIndex].value);
item2Item = window.getItem(item2.options[item2.selectedIndex].value);
item3Item = window.getItem(item3.options[item3.selectedIndex].value);
item4Item = window.getItem(item4.options[item4.selectedIndex].value);
}
var weight = 0;
if(item1Item != null){
weight += item1Item.weight;}
if(item2Item != null){
weight += item2Item.weight;}
if(item3Item != null){
weight += item3Item.weight;}
if(item4Item != null){
weight += item4Item.weight;}
weaponWeight = weight.toFixed(1);
if(armorWeight != null && weaponWeight != null)
{
total = (parseFloat(armorWeight) + parseFloat(weaponWeight)).toFixed(1);
totalweightLabel.innerHTML = total;
}
}
function CalculateWpf(baseWpf){
// src: http://forum.melee.org/beginner%27s-help-and-guides/game-mechanic-megathread!/msg341261/#msg341261
// Armor weight modified proficiency = base proficiency * (1 - 0.01 * effective armor weight)
// Effective armor weight = 2*head armor weight + body armor weight + leg armor weight + 6*hand armor weight - a dynamic weight threshold of the max of 6, STR / 3, and IF * 2
// (Source: WaltF4, updated 31.7.2012 based on the new formula)
// Slightly outdated, but very close to actual wpf//
return Math.ceil((Math.abs((2 * effectiveArmorWeight)/3 - 100) * baseWpf) / 100);
}
function CalculateWpfRanged(baseWpf){
// src: http://forum.melee.org/beginner%27s-help-and-guides/game-mechanic-megathread!/msg341261/#msg341261
// Armor weight modified proficiency = base proficiency * (1 - 0.01 * effective armor weight)
// Effective armor weight = 2*head armor weight + body armor weight + leg armor weight + 6*hand armor weight - a dynamic weight threshold of the max of 6, STR / 3, and IF * 2
// (Source: WaltF4, updated 31.7.2012 based on the new formula)
// Slightly outdated, but very close to actual wpf//
return Math.ceil((Math.abs(effectiveArmorWeight - 100) * baseWpf) / 100);
}
function UpdateWpfTable(){
var penalty = effectiveArmorWeight > 0;
e1hWpfElement.innerHTML = '<b>' + (base1hWpf > 1 ? (penalty ? CalculateWpf(base1hWpf) : base1hWpf) : 1) + '</b>/' + base1hWpf;
e2hWpfElement.innerHTML = '<b>' + (base2hWpf > 1 ? (penalty ? CalculateWpf(base2hWpf) : base2hWpf) : 1) + '</b>/' + base2hWpf;
epolewpfElement.innerHTML = '<b>' + (basePoleWpf > 1 ? (penalty ? CalculateWpf(basePoleWpf) : basePoleWpf) : 1) + '</b>/' + basePoleWpf;
var tmp = 0;
if(baseThrowWpf > 1)
{
var tmp = CalculateWpf(baseThrowWpf) - 11*basePT;
}
throwWpfElement.innerHTML = '<b>' + (baseThrowWpf > 1 ? (penalty ? (tmp > 0 ? CalculateWpfRanged(tmp) : 0) : Math.max(baseThrowWpf - 11*basePT, 0)) : 1) + '</b>/' + baseThrowWpf;
xbowWpfElement.innerHTML = '<b>' + (baseXbowWpf > 1 ? (penalty ? CalculateWpfRanged(baseXbowWpf) : baseXbowWpf) : 1) + '</b>/' + baseXbowWpf;
if(baseArcheryWpf > 1)
{
tmp = CalculateWpf(baseArcheryWpf) - Math.max(14*basePD - 1.35^basePD - 35, 0);
}
archeryWpfElement.innerHTML = '<b>' + (baseArcheryWpf > 1 ? (penalty ? (tmp > 0 ? CalculateWpfRanged(tmp) : 0) : (Math.max(baseArcheryWpf - Math.max(14*basePD - 1.35^basePD - 35, 0)),0)) : 1) + '</b>/' + baseArcheryWpf;
}
function EndIndexOf(text, search){
if(text != null && search != null){
var ind = text.indexOf(search);
if(ind > -1)
return ind + search.length;
}
}
function LoadWpfValues(){
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", 'http://c-rpg.net/index.php?page=charstats', false );
xmlHttp.send( null );
var data = xmlHttp.responseText;
var start = EndIndexOf(data, 'id="wpfOneHandedField" value="');
var val = data.substring(start, data.indexOf('"', start));
base1hWpfTemp = parseInt(val);
start = EndIndexOf(data, 'id="wpfTwoHandedField" value="');
val = data.substring(start, data.indexOf('"', start));
base2hWpfTemp = parseInt(val);
start = EndIndexOf(data, 'id="wpfPolearmField" value="');
val = data.substring(start, data.indexOf('"', start));
basePoleWpfTemp = parseInt(val);
start = EndIndexOf(data, 'id="wpfThrowingField" value="');
val = data.substring(start, data.indexOf('"', start));
baseThrowWpf = parseInt(val);
start = EndIndexOf(data, 'id="wpfCrossbowField" value="');
val = data.substring(start, data.indexOf('"', start));
baseXbowWpf = parseInt(val);
start = EndIndexOf(data, 'id="wpfArcheryField" value="');
val = data.substring(start, data.indexOf('"', start));
baseArcheryWpf = parseInt(val);
start = EndIndexOf(data, 'id="skillPowerDrawField" value="');
val = data.substring(start, data.indexOf('"', start));
basePD = parseInt(val);
start = EndIndexOf(data, 'id="skillPowerThrowField" value="');
val = data.substring(start, data.indexOf('"', start));
basePT = parseInt(val);
start = EndIndexOf(data, 'id="skillIronFleshField" value="');
val = data.substring(start, data.indexOf('"', start));
baseIF = parseInt(val);
baseStr = document.getElementById('attrStrength');
base1hWpf = Math.floor((Math.max(base2hWpfTemp*0.7-30, 0) + Math.max(basePoleWpfTemp*0.7-30, 0)) * 0.3 + base1hWpfTemp);
base2hWpf = Math.floor((Math.max(base1hWpfTemp*0.7-30, 0) + Math.max(basePoleWpfTemp*0.7-30, 0)) * 0.3 + base2hWpfTemp);
basePoleWpf = Math.floor((Math.max(base1hWpfTemp*0.7-30, 0) + Math.max(base2hWpfTemp*0.7-30, 0)) * 0.3 + basePoleWpfTemp);
e1hWpfElement = document.getElementById('effective1hWpf');
e2hWpfElement = document.getElementById('effective2hWpf');
epolewpfElement = document.getElementById('effectivePoleWpf');
throwWpfElement = document.getElementById('effectiveThrowWpf');
xbowWpfElement = document.getElementById('effectiveXbowWpf');
archeryWpfElement = document.getElementById('effectiveArcheryWpf');
}
function Init(){
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+
isChrome = !!window.chrome && !isOpera; // Chrome 1+
weightLabel = document.getElementById('armorweight');
totalweightLabel = document.getElementById('totalweight');
effectiveWeightLabel = document.getElementById('effectiveArmorWeight');
head = document.getElementById('itemheadvalue');
body = document.getElementById('itembodyvalue');
legs = document.getElementById('itemlegvalue');
hand = document.getElementById('itemhandvalue');
item1 = document.getElementById('itemweapon1value');
item2 = document.getElementById('itemweapon2value');
item3 = document.getElementById('itemweapon3value');
item4 = document.getElementById('itemweapon4value');
AddItemChangedEvent(head, UpdateArmorWeight);
AddItemChangedEvent(body, UpdateArmorWeight);
AddItemChangedEvent(legs, UpdateArmorWeight);
AddItemChangedEvent(hand, UpdateArmorWeight);
AddItemChangedEvent(item1, UpdateItemWeight);
AddItemChangedEvent(item2, UpdateItemWeight);
AddItemChangedEvent(item3, UpdateItemWeight);
AddItemChangedEvent(item4, UpdateItemWeight);
LoadWpfValues();
}
function AddItemChangedEvent(el, func){
if(el != null){
if (el.addEventListener){
el.addEventListener('change', func, false);}
else{
el.attachEvent('change', func);}
}
}
var upkeepElement = document.getElementById('upkeep');
var saveEl = document.getElementsByName('save');
if(upkeepElement != null){
awdiv = document.createElement('div');
awdiv.className = 'labelvalue groupstart';
awspan = document.createElement('span');
awspan.id = 'armorweight';
awspan.className = 'value';
awlabel = document.createElement('span');
awlabel.className = 'label';
awlabel.innerHTML = 'Armor weight';
awdiv.appendChild(awspan);
awdiv.appendChild(awlabel);
upkeepElement.parentNode.parentNode.appendChild(awdiv);
twdiv = document.createElement('div');
twdiv.className = 'labelvalue groupstart';
twspan = document.createElement('span');
twspan.id = 'totalweight';
twspan.className = 'value';
twlabel = document.createElement('span');
twlabel.className = 'label';
twlabel.innerHTML = 'Total weight';
twdiv.appendChild(twspan);
twdiv.appendChild(twlabel);
upkeepElement.parentNode.parentNode.appendChild(twdiv);
ewdiv = document.createElement('div');
ewdiv.className = 'labelvalue groupstart';
ewspan = document.createElement('span');
ewspan.id = 'effectiveArmorWeight';
ewspan.className = 'value';
ewlabel = document.createElement('span');
ewlabel.className = 'label';
ewlabel.innerHTML = 'Wpf penalty weight';
ewdiv.appendChild(ewspan);
ewdiv.appendChild(ewlabel);
upkeepElement.parentNode.parentNode.appendChild(ewdiv);
if(saveEl != null && saveEl.length > 0){
gridr = document.createElement('div');
gridr.className = 'gridrow';
gridc = document.createElement('div');
gridc.className = 'gridcol full';
wpft = document.createElement('div');
wpft.className = 'header2';
wpfh = document.createElement('h1');
wpfh.innerHTML = 'Stat modifiers';
desc = document.createElement('div');
desc.className = 'desc';
desct = document.createElement('span');
desct.innerHTML = 'Approximate effective WPF with selected equipment.';
wt = document.createElement('div');
wt.className = 'gridrow';
wt.Id = 'wpfTable';
wt.innerHTML = '<table style=\'border=0px; margin-left:7px;margin-top:10px\'>'+
'<tr><td style="padding-right:10px">One Handed:</td><td id=\'effective1hWpf\'></td></tr>'+
'<tr><td>Two Handed:</td><td id=\'effective2hWpf\'></td></tr>'+
'<tr><td>Polearm:</td><td id=\'effectivePoleWpf\'></td></tr>' +
'<tr><td>Throwing:</td><td id=\'effectiveThrowWpf\'></td></tr>' +
'<tr><td>Crossbow:</td><td id=\'effectiveXbowWpf\'></td></tr>' +
'<tr><td>Archery:</td><td id=\'effectiveArcheryWpf\'></td></tr></table>';
desc.appendChild(desct);
wpft.appendChild(wpfh);
wpft.appendChild(desc);
gridc.appendChild(wpft);
gridr.appendChild(gridc);
pnode = saveEl[0].parentNode.parentNode.parentNode;
pnode.insertBefore(document.createElement('br'), pnode.nextSibling);
pnode.insertBefore(gridr, pnode.nextSibling);
pnode.insertBefore(wt, pnode.nextSibling);
}
Init();
UpdateArmorWeight();
}
-
Well, there would still be many secrets and wonders left in crpg to feed our imagination...
However, I think if the whole system, including damage calculations, armor effect etc. would be more transparent, maybe there would be less uneducated whining about supposedly OP weapons and consequently less unneeded "balancing". Besides, if devs would be forced to understand the system, they wouldn't need item balancers to hang around on servers using their "show names cheat" all the time to get questionable results, because they could simply calculate stuff.
There used to be this excellent online character planner and damage calculator tool. Shame it's not there anymore.
-
and I feel fine with that tbh.
Better let some exact game mechanics be hidden
Why on earth would you be opposed to seeing your effective wpf with your stats?
-
This and many other hidden things like the minimum required wpf per Power Throw skill.
And the many other hidden features.
After 8 years playing cRPG I still don't know if it is 12 or 13 per skill, yet I still have message "your proficiency in throw is too low".
So except devs that get access to the formulas and some few privileged, the rest are fooled.
And for sure if I was a dev I would divulge these information, that's probably why I never became one.
Another example, that's only few person know, on DTV you don't need to have Athletics and Riding, if you invest all your points in Riding you get hidden Athletics points to the same amount.
thanks to chadz who always made it trouble and secret, even after we, the community, invested for one of his project.
/settle accounts
-
You want the truth? You can't handle the truth!
-
Why on earth would you be opposed to seeing your effective wpf with your stats?
That would cause a shitstorm of threads because people would realize the heavy gauntlets are ruining effective wpf for any non-pure STR build.
-
We deserve the truth. A good chunk of the formulas are outdated, and it's been 8 years nearly in the dark when it comes to penalties and damage formulae because of how often they changed.
-
Another example, that's only few person know, on DTV you don't need to have Athletics and Riding, if you invest all your points in Riding you get hidden Athletics points to the same amount.
I forgot all about that. Used to actually make sense since any cav build would be severely nerfed in the old dtv, being unable to actually be a "cav" build and all. Now that you can ride horses this seems a tad OP, rofl.
-
That would cause a shitstorm of threads because people would realize the heavy gauntlets are ruining effective wpf for any non-pure STR build.
That would be fucking hilarious, I don't know why you don't want to see this.
-
And another thing: why aren't we allowed to see how much damage we deal? Why was it disabled a long time ago? What are you hiding from us? Damage display used to be our birth-right since the original M&B, and yet, after many years of darkness and deception, we have almost forgotten that it ever existed. We are human beens for christ's sake! You can't treat us like that!
-
Seriously, why was damage display removed again?
-
I forgot all about that. Used to actually make sense since any cav build would be severely nerfed in the old dtv, being unable to actually be a "cav" build and all. Now that you can ride horses this seems a tad OP, rofl.
Well a lot of cavs on DTV use horse to move quickly at the beginning of the first wave, horses can't be healed, so unless having a heavy horse with a heavy armor to survive to arrows raining they never last longer. And when I use my medium-heavy cav build I never gain money with the high repair incomes.
Cavalry is usefull to kill the last bots standing stuck at their respawn and give ability to infantry to fall back, basically a support class that how it should be.
-
I kind of updated it, works for me on Chrome (but not firefox, may be the shit ton of addons I have). Idk too much about it other than tweaks, so someone else can take the code and improve.
Tampermonkey
https://gist.github.com/smj72/bd81b6fd62ff2b8b5a89/raw/cRPGInfoAddon.user.js