In my particular opinion, it would be good if you gave modders flexibility to adapt this new temporary script, even if it did not have the different animation.
In case you decide that this temporary buff will be fixed, I present what I have in mind with your script:
Medikit: heals wounds and contains analgesics and stimulants (the same as the vanilla medikit)
Campaign surgery kit: the same as the Medikit, but much better. (Extra +5 Health, +2 Stamina)
we cant set Yankes script for medcit use.
Trench Whistle: encourages the troops, raises the reactions and courage. (+7 TU, +10 Bravery, +5 reactions)
Combat Bagpipe: increases bravery, slightly strength, melee damage and stamina (+3 TU, +15 Bravery, +3 Strength, +4 Melee, +4 Stamina)
can be done with first script
Bandages: for bleeding and recover a little health. (Stops bleeding, +3 health)
can be done without scripting with OXCE
Flamethrower: well... is a flamethrower, but reduces enemy reactions and bravery to emule the fear of being roared alive (-10 Reactions, -5 Bravery)
there are mecanics for it already
Most of them for three turns, except the medikits and surgery lit, these are more like vanilla medikit.
can be done without scripting with OXCE
you know, tracking debuff end restore stut to its original value is pretty comlycated thing, so if you can satisfy with permanent buff from first script - just mod and item like i describe above
if you want to make trackable debuff - ill better teach you how to script it =) i dont think trackable debuff made verstile with tags will be unreosanable comlicated both to wright and use for modders
--- posts merged ---what do you think, guys? this script makes daze on a target, hitted with proper item and fade out in set ammount of turns
extended:
tags:
RuleItem:
FTAG_DAZE_VALUE: int
FTAG_DAZE_TIME: int
BattleUnit:
FTAG_ISDAZED: int #not shure about it
FTAG_DAZE_ENDTURN: int
FTAG_DAZE_ORIGINAL_TIMEUNITS: int
FTAG_DAZE_ORIGINAL_REACTIONS: int
FTAG_DAZE_ORIGINAL_FIRING: int
FTAG_DAZE_ORIGINAL_THROWING: int
FTAG_DAZE_ORIGINAL_MELEE: int
scripts:
hitUnit:
- offset: 1
code: |
var ptr RuleItem itemRuleset;
var int dazeTag;
var int dazeValue;
var int statValue;
var int debuffValue;
var int dazeTime;
var int endTurn;
unit.getTag dazeTag Tag.FTAG_ISDAZED;
if eq dazeTag 69; # Make sure unit already have daze debuff
return power part side;
end;
set dazeTag 69; #set dazed tag
unit.setTag Tag.FTAG_ISDAZED dazeTag;
damaging_item.getRuleItem itemRuleset; #get debuff stats from item
itemRuleset.getTag dazeValue Tag.FTAG_DAZE_VALUE;
itemRuleset.getTag dazeTime Tag.FTAG_DAZE_TIME;
if neq dazeValue 0;
unit.Stats.getTimeUnits statValue; #remember original TimeUnits stat
unit.setTag Tag.FTAG_DAZE_ORIGINAL_TIMEUNITS statValue;
div statValue 2; #calculate TimeUnits debuff, deviding it by 2
unit.Stats.setTimeUnits statValue; #apply debuff
clear statValue;
unit.Stats.getReactions statValue; #remember original Reactions stat
unit.setTag Tag.FTAG_DAZE_ORIGINAL_REACTIONS statValue;
battle_game.randomRange debuffValue 25 35; #calculate random, 25-35 for Reactions
mul debuffValue dazeValue; #calculate debuff
sub statValue debuffValue;
unit.Stats.setReactions statValue; #apply Reactions debuff
clear statValue;
clear debuffValue;
unit.Stats.getFiring statValue; #remember original Firing stat
unit.setTag Tag.FTAG_DAZE_ORIGINAL_FIRING statValue;
battle_game.randomRange debuffValue 20 30; #calculate random, 20-30 for Firing
mul debuffValue dazeValue; #calculate debuff
sub statValue debuffValue;
unit.Stats.setFiring statValue; #apply debuff
clear statValue;
clear debuffValue;
unit.Stats.getThrowing statValue; #remember original Throwing stat
unit.setTag Tag.FTAG_DAZE_ORIGINAL_THROWING statValue;
battle_game.randomRange debuffValue 20 30; #calculate random, 20-30 for Throwing
mul debuffValue dazeValue; #calculate debuff
sub statValue debuffValue;
unit.Stats.setThrowing statValue; #apply debuff
clear statValue;
clear debuffValue;
unit.Stats.getMelee statValue; #remember original Melee stat
unit.setTag Tag.FTAG_DAZE_ORIGINAL_MELEE statValue;
battle_game.randomRange debuffValue 10 20; #calculate random, 10-20 for Melee
mul debuffValue dazeValue; #calculate debuff
sub statValue debuffValue;
unit.Stats.setMelee statValue; #apply debuff
clear statValue;
clear debuffValue;
battle_game.getTurn endTurn;
add endTurn dazeTime; #define end turn for debuff
unit.setTag Tag.FTAG_DAZE_ENDTURN endTurn;
end;
return power part side;
newTurnUnit:
- offset: 2
code: |
var int currTurn;
var int endTurn;
var int dazeTag;
var int originalTimeUnits;
var int originalReactions;
var int originalFiring;
var int originalThrowing;
var int originalMelee;
# Make sure this doesn't run an extra time when civilians have a turn
if eq side 2;
return;
end;
unit.getTag dazeTag Tag.FTAG_ISDAZED;
unit.getTag endTurn Tag.FTAG_DAZE_ENDTURN;
unit.getTag originalTimeUnits Tag.FTAG_DAZE_ORIGINAL_TIMEUNITS;
unit.getTag originalReactions Tag.FTAG_DAZE_ORIGINAL_REACTIONS;
unit.getTag originalFiring Tag.FTAG_DAZE_ORIGINAL_FIRING;
unit.getTag originalThrowing Tag.FTAG_DAZE_ORIGINAL_THROWING;
unit.getTag originalMelee Tag.FTAG_DAZE_ORIGINAL_MELEE;
battle_game.getTurn currTurn;
if eq dazeTag 69;
if eq currTurn endTurn;
unit.Stats.setTimeUnits originalTimeUnits; #revent debuff
unit.Stats.setReactions originalReactions;
unit.Stats.setFiring originalFiring;
unit.Stats.setThrowing originalThrowing;
unit.Stats.setMelee originalMelee;
unit.setTag Tag.FTAG_ISDAZED 0; #cancel tag
end;
end;
return;
im hardcoded parameters of daze debuff, it halfs TUs, decrease reactions by 25-35, firing and throwing by 20-30, and melee by 10-20. numbers are subject of balance talking.
you still can adjust values. place this in your item.rul
tags:
FTAG_DAZE_VALUE: 1 #this is multiplyer to numbers above. if lower than 1, debuff will be weaker, if higher - stronger
FTAG_DAZE_TIME: 2 #number of turns before fading
here is example mod. note, its is submod for XCF, which, btw, i strongly recommend to check out
https://openxcom.mod.io/the-x-com-files