DEATH'S DOOR / LAST STAND MECHANIC (RMMV)

Posts

Pages: 1
Trying to use a system where characters at 0 HP can still act normally, but if they are hit again when at 0 HP they die.

I changed state #1 to "last stand" and set restriction to "none". I gave my enemy a skill with a 100% chance to add the "dead" state, and gave my actors a 0% state rate for "dead". The "last stand" state adds a state rate of 100% for "dead". "Last stand" is removed by healing skills.

When I tested this, my characters get the "last stand" state when they reach 0 HP, but their turns are still skipped over and the enemy no longer targets them. Eventually all characters have the "last stand" state and the battle ends saying my party was defeated. How to I make the game understand my characters are not dead at 0HP?
Marrend
Guardian of the Description Thread
21806
With MZ, it's hard-coded in Game_BattlerBase that state #1 is the "dead" state.

Game_BattlerBase.prototype.deathStateId = function() {
    return 1;
};

This was true for Ace as well.

class Game_BattlerBase
  def death_state_id
    return 1
  end
end

So, I find it likely that it's similarly hard-coded into MV. That might also be why enemies don't target characters with that state: because the scope of the skill reads those characters as "dead", and the scope of offensive skills tend to target non-dead enemies. My guess is that you can't target your allies with healing either because the things you're trying to heal them with targets non-dead allies, with the game also reading them as "dead".

However, I'm not sure if it's so simple as replacing the value of the dead state ID to be whatever you need it to be. The design intent is for characters, not enemies, to have a "Last Stand" state before they can be afflicted with "Dead". We're probably talking about some kind of replacement effect of what state to apply given the existence, or lack thereof, of a "Last Stand" state. The replacement effect probably needs to be in Game_Actor, but, more than that, I'm not 100% sure where the check would be.
You might be able to make it by giving characters a perma-state at the start of each fight that makes them Immortal (it's an option in the state system), boost them back up to 1HP if they hit 0, and then remove that state, making them killable if they take any more damage?

There's probably more finnicky stuff to do to make it fully work (like making all healing spells put the Immortal-granting state back on, etc), but it's not a bad start.

I think there might be a conditional Passive State plugin that Yanfly made that might be able to do the "You always have it, turn it off once you take a fatal hit" thing more or less automatically, not 100% sure though.
JustAShyDoge
Still a dumb and shy doggo
9731
MMmmm, I smell MV, with a little help from some plugins you could almost replicate such effect with yanfly's second chance.

http://www.yanfly.moe/wiki/Second_Chance_(MV_Plugin_Tips_%26_Tricks)

Not sure if this is what you want, but I see the similarity.
author=JustAShyDoge
MMmmm, I smell MV, with a little help from some plugins you could almost replicate such effect with yanfly's second chance.

http://www.yanfly.moe/wiki/Second_Chance_(MV_Plugin_Tips_%26_Tricks)

Not sure if this is what you want, but I see the similarity.

So far I ended up doing something a little different by making 2 different states, the first one being "second chance" and the second one being a slightly modified version of second chance where if the actors HP = 0, a random number is rolled against the actors TP (I am using TP as fatigue). The idea is that actors will hang on at 1HP but take increased fatigue damage, until they eventually die when the RNG rolls higher than their Fatigue.

I haven't tested this yet but it looks like "second chance" will not trigger when an actor is killed by DoT effects. Any ideas there?
JustAShyDoge
Still a dumb and shy doggo
9731
author=phatlizzy51
So far I ended up doing something a little different by making 2 different states, the first one being "second chance" and the second one being a slightly modified version of second chance where if the actors HP = 0, a random number is rolled against the actors TP (I am using TP as fatigue). The idea is that actors will hang on at 1HP but take increased fatigue damage, until they eventually die when the RNG rolls higher than their Fatigue.

I haven't tested this yet but it looks like "second chance" will not trigger when an actor is killed by DoT effects. Any ideas there?


I took some experiment and notice that <Category: Bypass Death Removal>(yanfly state plugin) does not bypass DoT as well. This might have to do with how the default engine handles slip damage, which I am not proficient enough to mess around with, sorry :(

Experiment was done with: Yanfly's auto life(auto resurrection when hit by damage higher than current hp)
I had another idea, instead of using "second chance", if I gave actors a passive state that resists the "death" state, with a passive condition tied to a RNG that fires every time the actor is hit by an attack or by DoT. They would hang on at 0 HP and still be able to fight as long as their fatigue level (TP) is higher than the RNG number.

Is there a way to trigger an event based on the actor receiving damage? I'm not sure whether or not that would work with the actors being at 0 HP because their HP will not go down when hit.
Marrend
Guardian of the Description Thread
21806
My train of thought is going somewhere like this:

-The passive state that resists death is applied to all allies at the beginning of combat.
-They also get another state that has no benefits or penalties, but dissolves when taking damage. It is applied at the beginning of each round of combat
-You do a check at the end of the turn/round to see if the "damage-wall" state is still there.
--If it's not there, check to see if they have 0 HP.
---If they do, check against the RNG.
----If the RNG fails, the resist death state dissolves, and they should follow suit?
author=Marrend
My train of thought is going somewhere like this:

-The passive state that resists death is applied to all allies at the beginning of combat.
-They also get another state that has no benefits or penalties, but dissolves when taking damage. It is applied at the beginning of each round of combat
-You do a check at the end of the turn/round to see if the "damage-wall" state is still there.
--If it's not there, check to see if they have 0 HP.
---If they do, check against the RNG.
----If the RNG fails, the resist death state dissolves, and they should follow suit?


I like the idea of the "damage wall" applied at the beginning of each round, but I'm not sure how to incorporate the RNG part. I need an event or something that fires whenever a character receives damage so that I can run the RNG. Maybe an event that runs when the state is removed?
Marrend
Guardian of the Description Thread
21806
I don't know if it's possible to check against a state in a troop page's conditions in the context of MV. I only have Ace, and Ace can check to see if a specific character's HP is 0. Which is still something we want to know. Maybe we can work within those confines, though?

What I'm thinking is a set-up of a troop event page with the aforementioned condition of a character's HP being 0. Set the span to "moment". Though, this can be tricky, because "moment", at least for Ace, is...

Moment
Repeats page execution as long as conditions continue to be met. Note that the battle may not proceed unless you add some sort of control process, such as a switch.


...a loop process. However, I would at least perform a check for the "damage-wall" state on that troop-event page. If the state is not there, you do a Control Variables, and set it to a random number. If you're comparing against Fatigue/TP, you can probably go between 0 and 100. You'll have to do another Control Variables to store the value of the character's current Fatigue/TP value to be able to compare against the roll and the Fatigue/TP value to see which is higher.

I think the trick to getting this to not loop might be to set the character's HP to at least 1 after all the checks resolve, and the character is still alive. Otherwise, at least in theory, it would just run the event-code again until the character dies. Not that I'm 100% sure that it wouldn't run if a character is dead. Might need another handler?
I think I've got it now! I went back to using the "second chance" state and modified the notes to account for DoT effects as well as enemy attacks.

Below is the modified note tag for State #2 "Second Chance". I am using MP here as a "fatigue" stat instead of it's traditional use.

<Custom React Effect>
if ($gameParty.inBattle()) {
target._secondChance = (target.mp + (target.hp * 100) - 100) > Math.randomInt(100);
}
</Custom React Effect>

<Custom Respond Effect>
if ($gameParty.inBattle() && target._secondChance && target.hp <= 0) {
target.setHp(1);
}
</Custom Respond Effect>

<Custom Turn Start Effect>
if ($gameParty.inBattle()) {
target._dotSurvive = (target.mp + (target.hp * 100) - 100) > Math.randomInt(100);
}
</Custom Turn Start Effect>

<Custom Regenerate Effect>
if ($gameParty.inBattle() && target._dotSurvive && target.hp <= 0) {
target.setHp(1);
}
</Custom Regenerate Effect>


I had to add <Category: Bypass Death Removal> to the notes in my DoT effects so they would trigger the "regenerate effect" after knocking HP down to 0.

I used a formula to make sure attacks/DoT could not kill me if my HP is greater than 1, while also using MP as a fatigue metric vs the RNG. If HP is greater than 1, the RNG will never roll higher than (target.mp + (target.hp * 100) - 100). Also, if HP = 0, characters that are already dead should not revive.

I'm using the following plugins from Yanfly:
-Buffs & States Core
-State Categories
-Extended DoT
-Auto Passive States

Pages: 1