as of now, you read the weapon stats from the original obdata.dat file, right?
looking at the
UFOpaedia article on obdata.dat, that file appears to have a lot of unused stuff... for example:
41[0x29]: TU% cost when attacking as a melee weapon
50 Most objects
30 Stun rod
40 TFTD thermal tazer
10 Vibroblade
15 Thermal lance
20 Heavy thermal Lance
0 All Corpses
0 Electroflare
0 Plasma Weapon Clips
basically everything except corpses, electroflares and plasma weapon clips has a value for melee attack TU cost. at the same time, the ability to melee attack appears to be hardcoded in the original exe.
how does openxcom handle this? in battlescape.cpp I found this:
void ActionMenuItem::setAction(BattleActionType action, std::wstring description, std::wstring accuracy, std::wstring timeunits, int tu)
{
_action = action;
_txtDescription->setText(description);
if (accuracy.length())
_txtAcc->setText(accuracy);
else
_txtAcc->setVisible(false);
_txtTU->setText(timeunits);
_tu = tu;
draw();
}
if I read it correctly, openxcom checks whether an accuracy value for an action has been defined, and if yes, displays the appropriate button.
However, the UFOpaedia article mentioned above states that the accuracy for melee attack is defined as
40[0x28]: Melee Accuracy. Zombie found that changing this does not change the Stun Rod's 100% accuracy (nor does changing soldier Melee Accuracy). Thus the Stun Rod appears to be hard-wired to 100% for UFO, but in TFTD it is a valid and effective variable. (TFTD uses much more melee than UFO.)
0 All Corpses
0 Electroflare
0 Plasma Weapon Clips
100 Everything else...
so why doesn't every weapon show the melee attack (except corpses, electroflares and plasma weapon clips) in openxcom?