Well, I don't know if this should go here, but if it's in the wrong forum please move it to the right one.
With that aside. Hi, I've been having troubles modifying a script with an if statement.
The script is Dual Wield Separate Attacks by Lytanathan. The script let you specify a number of skills and then, if you are dual wielding when using one of those skills, it calculates the damage of 2 separate hits, 1 for each weapon. Thanks to this thread, one can modify the script to fix one problem while unarmed and to sort of modify the damage of the second hit via applying and removing a state. The problem is that, if using this solution, the actual weapon that gets its damage reduced with a state, its the first one, not the second one, that leads to confusion with some things, but basically, I tried to add an if to let the first attack happen and then, with the state, reduce the damage of the second attack.
This was my attempt:
It just end up going for the elsif all the time and I don't know why because the second time it should take the normal if.
I don't know a lot of ruby so I checked the manual on the editor for help about variables and conditionals, but I don't understand why this isn't working.
If anyone can help me with a lead or something I would really appreciate it.
With that aside. Hi, I've been having troubles modifying a script with an if statement.
The script is Dual Wield Separate Attacks by Lytanathan. The script let you specify a number of skills and then, if you are dual wielding when using one of those skills, it calculates the damage of 2 separate hits, 1 for each weapon. Thanks to this thread, one can modify the script to fix one problem while unarmed and to sort of modify the damage of the second hit via applying and removing a state. The problem is that, if using this solution, the actual weapon that gets its damage reduced with a state, its the first one, not the second one, that leads to confusion with some things, but basically, I tried to add an if to let the first attack happen and then, with the state, reduce the damage of the second attack.
This was my attempt:
$wfa = "main" #I added this line here
#Remember equipped weapons
weapon_list = @subject.weapons
#Perform attacks
if $wfa == "off" #And changed the line that was here for the if
target.add_state(12 + current_weapon)
lyt_dwsa_apply_item_effects(target, item)
target.remove_state(12 + current_weapon)
elsif $wfa == "main"
lyt_dwsa_apply_item_effects(target, item)
$wfa = "off"
end
#Remember equipped weapons
weapon_list = @subject.weapons
#Perform attacks
if $wfa == "off" #And changed the line that was here for the if
target.add_state(12 + current_weapon)
lyt_dwsa_apply_item_effects(target, item)
target.remove_state(12 + current_weapon)
elsif $wfa == "main"
lyt_dwsa_apply_item_effects(target, item)
$wfa = "off"
end
It just end up going for the elsif all the time and I don't know why because the second time it should take the normal if.
I don't know a lot of ruby so I checked the manual on the editor for help about variables and conditionals, but I don't understand why this isn't working.
If anyone can help me with a lead or something I would really appreciate it.