I say it everytime "Hopefully this will be simple enough" and it never is, lol. Let's see if today's any different!
My game has a character with the ability to calm and tame animals and what I want is a way for the player to win a battle if the animal tamer calms the enemies down rather than killing them. They do this by afflicting them with a 'Soothed' status, which makes the enemy unable to act for a while (but is removed by damage, so you have to commit to the non-violent approach). Some enemies naturally will be easier to calm than others.
In-game design terms: I want the game to treat Soothed in a similar manner to how Final Fantasy treats Petrify, in that it counts as death if the entire troop is affected.
I thought all I would have to do is edit this in BattleManager:
Code:
#--------------------------------------------------------------------------
# * Determine Win/Loss Results
#--------------------------------------------------------------------------
def self.judge_win_loss
if @phase
return process_abort if $game_party.members.empty?
return process_defeat if $game_party.all_dead?
return process_victory if $game_troop.all_dead?
return process_abort if aborting?
end
return false
end
And change it to this:
Code:
#--------------------------------------------------------------------------
# * Determine Win/Loss Results
#--------------------------------------------------------------------------
def self.judge_win_loss
if @phase
return process_abort if $game_party.members.empty?
return process_defeat if $game_party.all_dead?
return process_victory if $game_troop.all_dead?
return process_victory if $game_troop.all_stateaffected(42)?
return process_abort if aborting?
end
return false
end
However this resulted in an error stating that the 'aborting' line was missing a colon, which makes no sense because it's not like there was one there already :S I tried moving my new line BELOW aborting but that resutled in a 'expected 'end'' error. Am I simply placing this in the wrong order? Did I write the line wrong (should I remove the word 'all_' or something)?
I would really rather not make this a battle event that I have to copy to every troop, plus there would be no way to earn gold and experience if I did it that way.
Hopefully this is simple T_T I'm so exhausted from trying to fix stuff that should take 5 minutes but takes a whole day instead.