the script for blinding foes in my ChemLasers mod seems to be bugged even though I changed nothing
there are 2 bugs listed here:
1. the text does not appear on damage
2. no affect happens
I don't know what the cause is and even after checking everything i cant figure anything out...
as such i am once again asking for
"you're supports"here is the code
damageUnit:
- offset: 99.2
code: |
#var ptre BattleUnit unit;
var ptr RuleItem itemRuleset;
var ptr RuleItem item_rule;
var ptr RuleItem RuleItem; #item_rule;
var ptr BattleUnit unit_battle;
var int laser_blind_power;
var int anti_laser_goggles;
var int goggles_are_broken;
var int is_blinded;
var int blindness_level;
var int curr_acc;
var int curr_rea;
var int curr_thw;
var int curr_acc_minus;
var int curr_rea_minus;
var int curr_thw_minus;
var int temp;
damaging_item.getRuleItem item_rule; #item_rule; damaging_item.getRuleItem RuleItem;
item_rule.getTag laser_blind_power Tag.LASER_BLIND_POWER;
item_rule.getTag anti_laser_goggles Tag.ANTI_LASER_GOGGLES;
#unit.getTag anti_laser_goggles Tag.ANTI_LASER_GOGGLES;
unit.getTag anti_laser_goggles Tag.UNIT_RESIST_ITEM_SLOT_300;
debug_log "check 1 LASER_BLIND_POWER: " laser_blind_power;
unit.Stats.getFiring curr_acc; #GeoscapeSoldier
unit.Stats.getReactions curr_rea; #GeoscapeSoldier
unit.Stats.getThrowing curr_thw; #GeoscapeSoldier
set curr_acc_minus curr_acc;
sub curr_acc_minus laser_blind_power;
set curr_rea_minus curr_rea;
sub curr_rea_minus laser_blind_power;
set curr_thw_minus curr_thw;
sub curr_thw_minus laser_blind_power;
#debug_log "check 2 LASER_BLIND_POWER: " laser_blind_power;
if and ge laser_blind_power 1 eq anti_laser_goggles 0;
unit.Stats.setFiring curr_acc_minus;
unit.Stats.setThrowing curr_thw_minus;
unit.Stats.setReactions curr_rea_minus;
battle_game.flashMessage "STR_LASER_BLINDED_DMG" laser_blind_power to_health to_armor;
#debug_log "blind is working";
else;
debug_log "blind is NOT working";
end;
return;
thank you for reading for reading this