Jump to content
PhoenixSoul

Item/Skill that revives and heals dead allies but also heals living allies (REQUESTED BY SOMEONE ELSE)

Recommended Posts

So, this is something I thought I could figure out, but my skill in RGSS is a bit lacking.

What this individual seeks is to use the method that checks for if any allies are 'dead', from Yanfly's Battle Engine without using said script, and modifying that to do the following:

Emulate Persona's revival skills so that if no allies are dead then the skill does nothing, but can still heal living allies if at least one ally is 'dead'.

I've no experience with the Persona series, so maybe someone else can aid me here.
@Rikifive? @Kayzee? @roninator2? Someone? Anyone? 😕

Share this post


Link to post
Share on other sites

I did this with common events and this code https://forums.rpgmakerweb.com/index.php?threads/recover-formula.79237/post-738710

And I have it for an item, but should work the same for a skill.

Formula is hp recover ((b.heal_mp(b.mmp))/4) ; b.mhp/4 # just to restore MP as well.

Call common event

Remove death state.

And if healing all members

Party recover hp + ????

 

For your condition of only useable if a party members is dead. I have it set to be used on one ally (dead).

Share this post


Link to post
Share on other sites
3 hours ago, Black Frost said:

otherwise it wouldn't work.

And what part of this would not work?

image.png.950b56260f861b3d112c2bcdff7f403b.pngimage.png.d0f848eb4061a3f47c766a1d5a25a9c7.png

 

Or

 

image.png.4bf0faaa3cf031e1220fcc05e21f2d10.png

 

and

 

image.png.fbcc95149b0b1c8905b3e22c716d868d.png

 

I use yanfly battle engine

 

* nevermind, You don't want to use the script. Ok Got it, First why? and second are you just trying to figure out what part of the script works, or are you trying to make the same effect without plagiarizing the yanfly battle script.

 

Share this post


Link to post
Share on other sites

I'm kinda confused what exactly is the skill supposed to do.

From what I understand, they want a skill that:

 

If at least one ally is dead:

> Revive ALL dead allies

> and RECOVER FULL HP of the ENTIRE PARTY

so that the whole party is revived and the whole party has their HP recovered when there was at least one dead member

 

Else, if no one is dead:

> Do absolutely nothing

 

Is that correct?

 

Then they might try this damage formula:

p=$game_party.battle_members; if p.any? { |a| a.dead? }; p.each { |a| a.revive; a.hp = a.mhp }; end

It will revive the entire party and recover full hp of the entire party (whether someone was dead or not) ONLY if there was at least one DEAD ally when the skill was used. Otherwise, do nothing.

 

WtvmtpT.png

Wouldn't common event work as well, as suggested above? What's the problem there?

Share this post


Link to post
Share on other sites

@Rikifive In the midst of the current project, there's a script that allows items/skills to both revive and heal everyone on both items and/or skills, and due to that, it messes up any other revival skills items, so the same effect from Yanfly is what's needed here to balance it out, making sure an ally is dead for the healing that comes with it to take effect.

@roninator2 Yes, the main idea is to find out what part of the yanfly battle system script causes it to change the revival setup, without having to plagiarize the original yanfly battle script.

Share this post


Link to post
Share on other sites

I don't know what exactly is the problem, nor what Yanfly's script has to do with this if you don't want to use it. We won't get anywhere if we'll be throwing vague references without actually explaining what one wants to achieve. :/

Not everyone played Persona and not everyone is using Yanfly's battle engine.

 

What exactly is messed up? Who actually requested that???? Who is able to give accurate answers? So far we have a complete mess here.

 

@PhoenixSoul What is going on here? Looks like posting a thread for someone else isn't the best idea.

Share this post


Link to post
Share on other sites

@PhoenixSoul Made this thread for me to help out a bit, but I thought I would at least help out a bit when it comes to explaining the idea at hand @Rikifive
What Yanfly's Battle Engine has to do with this is basically there's a function for Revival in the script itself that makes it so that if there's no allies that are alive, it would play the cancel SE and not be able to perform it, similar to when an ally has no SP/MP for a skill, and this thread to find out if there's a way to recreate it as a separate script instead of having to use the battle engine itself.

Share this post


Link to post
Share on other sites

So you just want to gray out a skill when no one is dead?

 

This is an absolutely different thing than what's in the OP and I'm confused - why didn't you make the thread yourself? Aaaanyway, if that's the goal, an another user asked for something similar, how about the script mentioned in that thread?

 

 

Share this post


Link to post
Share on other sites

@Rikifive I made this thread when I wasn't in the best headspace. However, if I hadn't done so, I most likely would of forgotten to.

It all correlates with just how stressed out I've been about everything going on. I'm doing my best, at capacity, no less!!!

Share this post


Link to post
Share on other sites
4 hours ago, Black Frost said:

if there's no allies that are alive, it would play the cancel SE and not be able to perform it, similar to when an ally has no SP/MP for a skill

And now that is something absolutely different than what was asked in OP. ;-;

 

@roninator2 looks like we got trolled a bit a ton lol

 

Aaaaaanyway, if graying out an item/skill if no one is dead is the case, then that would be a pretty cheap suggestion from me:

class Window_SkillList < Window_Selectable
  alias :revive_enable? :enable?
  def enable?(item)
    # Check if the item/skill contains "revive" in its note.
    # If yes, disallow use when no one is dead.
    if !item.nil?
      if item.note.include? "revive"
        return false if !($game_party.members.any? { |a| a.dead? })
      end
    end
    revive_enable?(item)
  end
end

class Window_ItemList < Window_Selectable
  alias :revive_enable? :enable?
  def enable?(item)
    # Check if the item/skill contains "revive" in its note.
    # If yes, disallow use when no one is dead.
    if !item.nil?
      if item.note.include? "revive"
        return false if !($game_party.members.any? { |a| a.dead? })
      end
    end
    revive_enable?(item)
  end
end

Pasting it in the materials will basically add one extra condition to skills/items, that have the word "revive" somewhere in their notes. For example,  like this:

b6inMt4.png

(that note scan could be better, but i said it's cheap and technically shouldn't really be a problem anyway dfEG13d.png)

 

If the item/skill will contain "revive" in the note, it will be grayed out (unusable) if there are no dead party members.

Share this post


Link to post
Share on other sites

I know, I know, don't worry about that.

Nevertheless, please approach that more careful next time. The whole thread was misleading and some of our precious time went to space. I know you want good @PhoenixSoul, but it's best if the one in need actually puts the effort to describe what they want, accurately.

 

It really took waaaaaaaaaaaaay longer than it should, because the goal kept changing and there was a mess in general.

Share this post


Link to post
Share on other sites
On 4/23/2020 at 7:11 PM, PhoenixSoul said:

Emulate Persona's revival skills so that if no allies are dead then the skill does nothing, but can still heal living allies if at least one ally is 'dead'.


Well, there is this, and I do believe it was a good attempt, but yeah. .......
 

Spoiler

Think I'll go and ...

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted