aliens

Author Topic: itemreplacement ammo for psiamp, oneway weapons, damaged melee weapons,..  (Read 2261 times)

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
my idea is an extension it items
the items ruleset get 2 new properties
Code: [Select]
  - type: STR_PSI_AMP
    replaceitem: STR_PSI_AMP_EMPTY
    replacecount: 1
what does that do?
after a targeted primary action (weapon fire, psiattack, mindprobe, meeleattack)
the item can be replaced
for the vanilla play there is obvious no change
but what can be accomplished
melee weapons can be damaged over time

after 10 hits with the combatknife it needs to be sharpened or it looses some damage

the stunrod gets better but after 3 hits you need to reload its battery in the base - so carry/bring more of these things

the psi amp can be remodelled to use ammunition (you can mod clips to psiamp but they have no effect the bulletconsumption is connected to createProjectile .. and psi has no projectiles)

to my knowledge there is only one one-way-weapon-mod SSLR - the trick here is that the weapon is not recovered after battle even if you dont use it .. with this only after the shot does SSLR convert to EMPTY_SSLR and the empty SSLR is not recovered but unused weapons stay in the base

i could think of one or two other applications of such thing

Spoilerbasic source idea:
(i am not sure if it is the best place )
after line 1289 in BattlescapeGame.cpp https://github.com/SupSuper/OpenXcom/blob/89e1e3d8418063d7e68713432dc2fbd71236b486/src/Battlescape/BattlescapeGame.cpp#L1289)
we would do something like that
if (replaceitem!="" ){
  _counter-=1
 if (..._counter==0){
   activeweapon.replace(replaceitem)
   ..._counter=activeweapon.getRules().getReplaceCount()
  }
}
i think at that position the counter goes down with cancelled actions (not enough TU) :(
« Last Edit: June 21, 2014, 01:17:36 pm by Falko »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11454
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
I think item transformation has a huge potential. Not just for one-shot weapons.