How to make a shield 'destroyed' by fire attacks.

Emberstorm

Resource Staff
Restaff
Joined
Jan 21, 2014
Messages
139
Reaction score
52
First Language
English
Primarily Uses
I need some help making a shield that when equipped, if the user is attacked by a fire element attack or spell, the shield is destroyed (think Deku Shield from Legend of Zelda). It would be nice to make it give a little message too saying that the shield was destroyed.


I'm using all the Yanfly Item engines if it helps. Can I make some sort of custom respond effect?

Thanks in advance.
 

Punamaagi

Hero on their own terms
Veteran
Joined
Jan 23, 2016
Messages
211
Reaction score
313
First Language
Finnish
Primarily Uses
RMMV
I managed to create the effect you want with Yanfly's Buff & States Core and Auto Passive States in the following way:

  1. Make a shield with the notetag <Auto Passive State: X> (X is the ID of "Vulnerable Shield" state)
  2. Make a "Vulnerable Shield" state (which you can name however you'd like) with the following notetag:

  3. <Custom React Effect>
    if (this.item().damage.elementId === Y) {
    var shield = $dataArmors[Z];
    if (target.hasArmor(shield)) {
    target.discardEquip(shield)
    var text = 'Fire destroyed ' + shield.name + '!';
    var window = SceneManager._scene._logWindow;
    window._lines.push(text + '<CENTER>');
    window.refresh();
    }
    }
    </Custom React Effect>


    Note that Y should be the ID of Fire element in the Types section of your database and Z the ID of the shield which you want to make vulnerable to fire.

I've attached a couple of screenshots to this post to show examples. I hope this was what you were after or at least helps you a little. :)


Shield-01.png


Shield-02.png
 
Last edited by a moderator:

Emberstorm

Resource Staff
Restaff
Joined
Jan 21, 2014
Messages
139
Reaction score
52
First Language
English
Primarily Uses
I managed to create the effect you want with Yanfly's Buff & States Core and Auto Passive States in the following way:

  1. Make a shield with the notetag <Auto Passive State: X> (X is the ID of "Vulnerable Shield" state)
  2. Make a "Vulnerable Shield" state (which you can name however you'd like) with the following notetag:


  3. <Custom React Effect>
    if (this.item().damage.elementId === Y) {
    var shield = $dataArmors[Z];
    if (target.hasArmor(shield)) {
    target.discardEquip(shield)
    var text = 'Fire destroyed ' + shield.name + '!';
    var window = SceneManager._scene._logWindow;
    window._lines.push(text + '<CENTER>');
    window.refresh();
    }
    }
    </Custom React Effect>


    Note that Y should be the ID of Fire element in the Types section of your database and Z the ID of the shield which you want to make vulnerable to fire.
 Thank you! This is perfect! :)
 

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,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top