Death Immunity...Loss after Battle

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
I have an ability that grants death immunity for a few turns. However upon the end of the battle it is instant game over if the player ends the battle with this state. I would prefer to make it so that the player cannot have <1 hp for the duration of the state but I can't think of any way to do that.

My other thought is to not have the state cleared at the end of battle and then have it removed during scripts. Really I'm at a loss as to what approach to take to get the desired effect. Any input would be appreciated, Thanks
 

Zechnophobe

Veteran
Veteran
Joined
Jul 17, 2013
Messages
93
Reaction score
2
First Language
English
Primarily Uses
I've done something similar but didn't have this problem, not sure what I did different. In my version the immortality state also gives a small health regen boost (5% in my game, which was about 2 HP). That might work as I think it will tick the regen before removing the state.
 

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
I've done something similar but didn't have this problem, not sure what I did different. In my version the immortality state also gives a small health regen boost (5% in my game, which was about 2 HP). That might work as I think it will tick the regen before removing the state.
The problem is I don't want them to be immortal, they still can take damage and receive states but I don't want them to drop below 1hp.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
You can modify the damage parts of the battle script to check for that state. if the unit has that state, then the max damage that you could deal to him should be equal to his hp - 1

try this

class Game_Battler < Game_BattlerBase     def make_damage_value(user, item)      value = item.damage.eval(user, self, $game_variables)      value *= item_element_rate(user, item)      value *= pdr if item.physical?      value *= mdr if item.magical?      value *= rec if item.damage.recover?      value = apply_critical(value) if @result.critical      value = apply_variance(value, item.damage.variance)      value = apply_guard(value)      value = self.state?(State ID for immortality here)? [value,self.hp-1].min : value      @result.make_damage(value.to_i, item)  end endthough it might be incompatible if your using any extra battle engines, since most of them overwrite this method too (but I can't think of how to do it via an alias so I did overwrite)... anyway, if ur using a script for battle engines you can just copy the second to the last line (the one that has the .state?), and paste it to that same place in the battle engine script...
 
Last edited by a moderator:

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
I am using Ace Battle Engine

I placed your line in the Ace Battle Engine Code with no luck

  #--------------------------------------------------------------------------
  # alias method: make_damage_value
  #--------------------------------------------------------------------------
  alias game_battler_make_damage_value_abe make_damage_value
  def make_damage_value(user, item)
    game_battler_make_damage_value_abe(user, item)
    rate = item_element_rate(user, item)
    make_rate_popup(rate) unless $game_temp.evaluating
    value = self.state?(26)? [value,self.hp-1].min : value
  end
 

I took a online class on ruby and I understand it but still I can't write script it's very frustrating I don't understand how I am supposed to learn it :(
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
because the damage is already set before that call...

since yanfly doesn't seem to overwrite it, you can create a new script at top of ABE, and paste the whole code in it...
 

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
You sir are a genius, might I bother you for one more thing > < ?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
about what?
 

ajilejay

Veteran
Veteran
Joined
Jul 17, 2013
Messages
64
Reaction score
0
First Language
English
Primarily Uses
What exactly is your process for figuring something like that out?

I want to write a script to use in combination with the yanfly stamina based system and I have a basic idea of what the code should look like. But I don't know where it should be placed or what should trigger it. I want to make it so abilities go on cooldown for x seconds and the cooldowns only tick down during stamina regeneration times.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Well, I started scripting with Wc3 years ago... I started with looking at the preset functions and figuring out how they were written, and how they work... Then I proceed to trying out things... So basically, trial and error...

And I did that same thing with RPG Maker... and so with visual basic

Anyway,for cooldowns, yanfly has a script for that I believe...

Though I still find the way scripts are arranged in RPM Maker quite confusing... Also, it's a bit harder to learn than wc3 and visual basic, mainly because there's no things such as auto-complete and function list for RGSS3 inside the editor... so you really need to know what you're writing...
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top