The tonberry is a classic Final Fantasy monster. Everyone wants to have a slowly advancing, green, yellow-eyed, fish-tailed midget of doom in their game. However, it isn't easy to implement them. Fortunately, I, ave369, being the nice girl I am, am going to teach you how.
First of all, you need the following plugins:
* Yanfly Battle Engine Core;
* Yanfly Animated Sideview Enemies;
* Yanfly Action Sequences 1-3;
* Yanfly Buffs and States;
* Yanfly Auto Passive States;
* And your favourite skill counterattack plugin that is compatible with all of the above.
First of all, you need an SV battler for your Tonberry. Ripping Final Fantasy graphics is a strictly verboten thing, but luckily you don't have to. In the attachment to this post, there's a Tonberry SV battler I made by photoshopping together various Kadokawa generator and sprite assets. It is not strictly accurate to the iconic Tonberry look, but it is legal to use in RPG Maker MV and looks nice. It does not have a full set of complete animations and is not suitable for use as an actor, but it has the frames we need for our Tonberry to do Tonberry things, namely casting, doinking and approaching menacingly. Note that this battler only has the lantern drawn and not the knife; this is normal, because we'll animate the knife as a weapon. WhtDragon's Joke Weapons set has a kitchen knife that will suit our Tonberry perfectly; look for it in the Resources section of this forum.
Use the battler I provided to create our enemy. Give it stats that look mighty fearsome relative to your game's particular balance. Name it. I named my enemy "Dinglberry"; it's a non-copyrighted synonym for a Tonberry used in some old classic FF translation (not to be confused with a dingleberry, which is entirely another thing; you can name it a Pug if you don't want your Tonberry to be a toilet joke). Add the following lines to your enemy's notes field:
Code:
<Sideview Battler: %Dinglberry2><Sideview Weapon: 126, swing, 7><Passive State: 70>
In this code, 126 is the number of the WhtDragon kitchen knife in my game weapon files, 7 is the Doink animation, and 70 is the ID of the Tonberries Killed Counter state (more on that below). Replace these numbers with your own.
Make a troop consisting of a single Dinglberry. It is important that it has to be a solitary enemy: all the code I wrote assumes that there's just one Dinglberry on the battlefield. If you want to rush your Actors with hordes of wild Tonberries, you'll have to modify my code and replace _enemySprites[0] with a more flexible reference to the current battler's sprite. Put the Dinglberry somewhere in the lower left part of the battlefield (I used the coords 213, 379).
Now you need to create 5 skills and 4 states. In my project, they are skills 230 to 234 and states 67 to 70. The numbers will be different in your game, so mind them and don't forget to replace them with your own.
The skills are:
* Tonberry Step 1 (Self)
* Tonberry Step 2 (Self)
* Tonberry Step 3 (Self)
* Doink! (One Enemy)
* Everyone's Grudge (One Enemy)
The states are:
* Tonberry Step 1
* Tonberry Step 2
* Tonberry Step 3
* Dead Tonberry Counter
The behaviour of our Tonberry will be the following: on the first action, it either casts Everyone's Grudge or walks 1/3 of the distance towards the player. If it chose Everyone's Grudge, on its next turn it will repeat the same choice. If it started to walk, it will keep walking until it reaches the party, does the Doink! and retreats back. Then the cycle repeats. If it is attacked, it counterattacks with Everyone's Grudge.
Input the following Action Sequence in the notes field of the skill Tonberry Step 1:
Code:
<setup action>motion skill: usermove user: point, 300, 350, 240wait for movementmotion wait: user</setup action><target action></target action><whole action></whole action><follow action></follow action><finish action>perform finishaction effect: user</finish action>
Insert the following effect into the Effects field of the skill Tonberry Step 1:
* Add State: Tonberry Step 1, 100%
Input the following Action Sequence in the notes field of the skill Tonberry Step 2:
Code:
<setup action>motion skill: usermove user: point, 400, 320, 240wait for movementmotion wait: user</setup action><target action></target action><whole action></whole action><follow action></follow action><finish action>perform finishaction effect: user</finish action>
Insert the following effect into the Effects field of the skill Tonberry Step 2:
* Add State: Tonberry Step 2, 100%
* Remove State: Tonberry Step 1, 100%
Input the following Action Sequence in the notes field of the skill Tonberry Step 3:
Code:
<setup action>motion skill: usermove user: point, 500, 300, 240wait for movementmotion wait: user</setup action><target action>action effect: target</target action><whole action></whole action><follow action></follow action><finish action>perform finishaction effect: user</finish action>
Insert the following effect into the Effects field of the skill Tonberry Step 3:
* Add State: Tonberry Step 3, 100%
* Remove State: Tonberry Step 2, 100%
Copy the Attack skill to start making the Doink! skill. Replace the damage formula with something appropriately scary. Insert the following Action Sequence into the Doink! skill notes field:
Code:
<setup action>display actionimmortal: targets, true</setup action><target action>move user: targets, front, 20zoom: 120%, 20camera screen: target, front center, 20camera focus: target, front center, 20wait for movementmotion attack: userwait: 10attack animation: targetwait for animationaction effectmove user: point, 213, 379, 60remove state 69: user</target action>
(69 being the ID of the Tonberry Step 3 state. Replace it with your own number!)
Now let's make the states. The states are important. They are the secret to making the Tonberry stay in place once it walks its steps, and do not return to its initial place on the battlefield until the deed is done. Insert the following Lunatic Code into the notes field of the Tonberry Step 1 State:
Code:
<Custom Apply Effect>SceneManager._scene._spriteset._enemySprites[0]._homeX = 300;SceneManager._scene._spriteset._enemySprites[0]._offsetX = 0;SceneManager._scene._spriteset._enemySprites[0]._homeY = 350;SceneManager._scene._spriteset._enemySprites[0]._offsetY = 0;</Custom Apply Effect>
Insert the following Lunatic Code into the notes field of the Tonberry Step 2 State:
Code:
<Custom Apply Effect>SceneManager._scene._spriteset._enemySprites[0]._homeX = 400;SceneManager._scene._spriteset._enemySprites[0]._offsetX = 0;SceneManager._scene._spriteset._enemySprites[0]._homeY = 320;SceneManager._scene._spriteset._enemySprites[0]._offsetY = 0;</Custom Apply Effect>
Insert the following Lunatic Code into the notes field of the Tonberry Step 3 State:
Code:
<Custom Apply Effect>SceneManager._scene._spriteset._enemySprites[0]._homeX = 500;SceneManager._scene._spriteset._enemySprites[0]._offsetX = 0;SceneManager._scene._spriteset._enemySprites[0]._homeY = 300;SceneManager._scene._spriteset._enemySprites[0]._offsetY = 0;</Custom Apply Effect><Custom Remove Effect>SceneManager._scene._spriteset._enemySprites[0]._homeX = 213SceneManager._scene._spriteset._enemySprites[0]._offsetX = 0;SceneManager._scene._spriteset._enemySprites[0]._homeY = 379SceneManager._scene._spriteset._enemySprites[0]._offsetY = 0;</Custom Remove Effect>
Now we have the skills and the states... but something is missing. That's right, the Everyone's Grudge skill. It should increase its damage with the numbers of Tonberries killed by the player party. To count the dead, we'll reserve a variable; in my project, it's the variable 44, but feel free to assign any variable you want. Create a state named Dead Tonberry Counter (in my project it's the state 70), and insert the following Lunatic Code into its notes field:
Code:
<Custom Deselect Effect>if (target.hp == 0) {$gameVariables.setValue(44, $gameVariables.value(44)+1);}
Do you remember that we wrote this state into the Dinglberry's notes field as a passive? Return there and replace the number 70 with the number of your own Dead Tonberry Counter state. Now create the Everyone's Grudge spell. Its most important part is the damage formula that uses $gameVariables.value(44). In my project, the formula is:
Code:
$gameVariables.value(44)*100 + 100
Design the animation, MP cost etc as you wish, it is not important.
We are almost done. What we need now is setting up the AI. Insert the following actions into Dinglberry's actions field:
* Tonberry Step 1: Always, 5
* Tonberry Step 2: If has state Tonberry Step 1, 9
* Tonberry Step 3: If has state Tonberry Step 2, 9
* Doink!: If has state Tonberry Step 3, 9
* Everyone's Grudge: Always, 5
Now the finishing touch: the counterattack. Read the help for the skill counterattack plugin you are using and put the appropriate line telling it to counterattack with Everyone's Grudge into Dinglberry's note field.
That's it! You've now got a perfectly functional Tonberry! Or rather Dinglberry. It's good form to rename the concepts you steal; it adds to the illusion that your game universe is original. Happy being doinked!
本贴来自国际rpgmaker官方论坛作者:ave36处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/tonberries-and-how-to-create-them-using-assorted-yanfly-plugins-and-lunatic-scripting.122320/