New idea with a weapon

I want to add in my game a weapon that basically damages the enemy, but it has 1% chance to do 1 hit KO. I already did this making a skill (i will replace the attack command with, using yanfly's weapon attack replace script). This skill has the same formula of basic attack, but 1% chance to add KO state. The only issue is that the player could use this against bosses, killing theme in one hit.
I don't want this, but i don't know how to solve. The way as bosses are defined in my game is a switch (i turn on before the battle and off after).

I thought how to do this and maybe a common event will help. The skill will call a common event that has the condition if boss switch is on do nothing, else control variable to casual numer 1-100.
if 1 add state to target (and there is the issue, i don't know if is possible to do this by event) else do nothing.
Any idea?
In my project, I add a conditional that checks to make sure the target's MaxHP is less than or equal to the user's MaxHP for any insta-kill effects. This ensures the effect only works on enemies weaker than you. Not sure if this helps you, but perhaps it can work for your project.
I want to add in my game a weapon that basically damages the enemy, but it has 1% chance to do 1 hit KO. I already did this making a skill (i will replace the attack command with, using yanfly's weapon attack replace script). This skill has the same formula of basic attack, but 1% chance to add KO state. The only issue is that the player could use this against bosses, killing theme in one hit.
I don't want this, but i don't know how to solve. The way as bosses are defined in my game is a switch (i turn on before the battle and off after).

I thought how to do this and maybe a common event will help. The skill will call a common event that has the condition if boss switch is on do nothing, else control variable to casual numer 1-100.
if 1 add state to target (and there is the issue, i don't know if is possible to do this by event) else do nothing.
Any idea?
instead of switch... i think it might be better to add 'boss state' to the boss so your actor can still one shot the 'minnions' in that battle... (ex the boss have summoning skill... you can still one shot the summon but cannot one shot the boss)

just add 'boss state' to the 'bosses' and all you don't want to be one shotted at start of battle (troop event turn 0)...

then it's better to add the 1%chance death state using damage formula instead of trait box / common event... and before that check wheter the target have "boss state" / "boss switch ON"...

i did not have ace installed (and long time did not use ace) so i don't know how to write the damage formula in ace version... but the logic is like this:

>> first check b(target) state affected with boss state or not?
yes:
- deal the formula damage only

no:
- roll random number (1-100) using rand(100) then use that as the percentage check
~ ex 1% will mean if only one number from 1-100 that activate the death attack...
- from random number above result either add death state to b(target) or deal the formula damage only...

hope someone could translate above logic to ACE damage formula... hope this help. 😀.
instead of switch... i think it might be better to add 'boss state' to the boss so your actor can still one shot the 'minnions' in that battle... (ex the boss have summoning skill... you can still one shot the summon but cannot one shot the boss)

just add 'boss state' to the 'bosses' and all you don't want to be one shotted at start of battle (troop event turn 0)...

then it's better to add the 1%chance death state using damage formula instead of trait box / common event... and before that check wheter the target have "boss state" / "boss switch ON"...

i did not have ace installed (and long time did not use ace) so i don't know how to write the damage formula in ace version... but the logic is like this:

>> first check b(target) state affected with boss state or not?
yes:
- deal the formula damage only

no:
- roll random number (1-100) using rand(100) then use that as the percentage check
~ ex 1% will mean if only one number from 1-100 that activate the death attack...
- from random number above result either add death state to b(target) or deal the formula damage only...

hope someone could translate above logic to ACE damage formula... hope this help. 😀.


It would be great, but I can't remove the switch, becouse i added it to every boss event in the game and it also active a different battle encounter sound by script.

EDIT:
Ok, i can do this also without remove the switch. I have to add the status in troops events at turn 0 right? I also son't know how to write this in ACE formula so i'll wait. Thanks.
In my project, I add a conditional that checks to make sure the target's MaxHP is less than or equal to the user's MaxHP for any insta-kill effects. This ensures the effect only works on enemies weaker than you. Not sure if this helps you, but perhaps it can work for your project.

Maybe, but it's not the safest way. I think i'll try becouse all of my bosses have lots of hp.
In my project, I add a conditional that checks to make sure the target's MaxHP is less than or equal to the user's MaxHP for any insta-kill effects. This ensures the effect only works on enemies weaker than you. Not sure if this helps you, but perhaps it can work for your project.

Can you show me hot to do this? By event or by formula?
It would be great, but I can't remove the switch, becouse i added it to every boss event in the game and it also active a different battle encounter sound by script.

EDIT:
Ok, i can do this also without remove the switch. I have to add the status in troops events at turn 0 right?
yes you can... alternatively you could also check the switch instead of b have boss state or not... but then in that battle you cannot kill the summoned minnion too...

sorry i cannot show the formula since it's been long time since i use ACE. 😀. you can try asking in ace damage formula thread...

edit:
reading some forum post and i try this:
ex: boss state is 99 and death state is of course 1 by default.
and the default skill damage formula is: a.atk * 3 - b.def * 2
Code:
b.state?(99)? a.atk * 3 - b.def * 2 : rand(100) == 1 ? b.add_state(1) : a.atk * 3 - b.def * 2
don't know does it work or not...
Can you show me hot to do this? By event or by formula?
I don't know the syntax for VXAce since I use MV, but anyway...I just use a simple conditional statement, which I believe you can put in the formula box.
if (a.mhp > b.mhp)
yes you can... alternatively you could also check the switch instead of b have boss state or not... but then in that battle you cannot kill the summoned minnion too...

sorry i cannot show the formula since it's been long time since i use ACE. 😀. you can try asking in ace damage formula thread...

edit:
reading some forum post and i try this:
ex: boss state is 99 and death state is of course 1 by default.
and the default skill damage formula is: a.atk * 3 - b.def * 2
Code:
b.state?(99)? a.atk * 3 - b.def * 2 : rand(100) == 1 ? b.add_state(1) : a.atk * 3 - b.def * 2
don't know does it work or not...


I don't seem to work... To incrase the chance (just for testing, i'll put it 100% so i'm sure it works) what do I have to do? Decrase the (100)?
I don't seem to work... To incrase the chance (just for testing, i'll put it 100% so i'm sure it works) what do I have to do? Decrase the (100)?
to increase the chance decrease the rand(100)... sorry i cannot test it because i did not have ACE installed >.<.
Just so you know, you can check a Switch in the formula instead of a State. I think the correct syntax would be:

$game_switches[X] == true ?
(Replace X with the Switch you are using to determine whether it's a boss)

instead of

b.state?(99)?

Additionally, since you are removing the abuse case for bosses, I really think you can safely turn up the chances to score an Instant KO!! 10 to 20% would be perfectly fine. To do this, you could replace

rand(100) == 1

with the following:

rand(100) < 15

and that would give you a 15% chance to get an automatic KO. Change 15 to whatever % chance you think is good.
Additionally, since you are removing the abuse case for bosses, I really think you can safely turn up the chances to score an Instant KO!! 10 to 20% would be perfectly fine.

Ain't that a good idea though? Like, 1/100 chance is pretty low... You'd statistically see that like, never. (Or that's what it'd feel like to me, but I'm impatient, like! 😀)

In a similar vein, you could just keep the 1/100 for everyone, including bosses! I'd like it if I could randomly cheese a boss like that! I mean, it's not like it'd statistically happen anyway...

You'd maybe hafta do it so it wouldn't kill the final boss, though. That'd feel cheap. Or maybe not? I mean, Fire Emblem: Genealogy of the Holy War had a mechanism where you were pretty much meant to cheese the final boss with one of the game's super weapons, and it didn't feel that cheap... I think. But maybe it was because that game was chock full of cheese anyway...

Alternatively, you could just design a game that didn't have a final boss. Or any bosses.
Just so you know, you can check a Switch in the formula instead of a State. I think the correct syntax would be:

$game_switches[X] == true ?
(Replace X with the Switch you are using to determine whether it's a boss)

instead of

b.state?(99)?

Additionally, since you are removing the abuse case for bosses, I really think you can safely turn up the chances to score an Instant KO!! 10 to 20% would be perfectly fine. To do this, you could replace

rand(100) == 1

with the following:

rand(100) < 15

and that would give you a 15% chance to get an automatic KO. Change 15 to whatever % chance you think is good.


It works perfectly! I kept the state condition instead of the switch becouse the formula is too large with the switch condition, anyway, thanks to everyone!
Couldn't this have simply been handled by giving your weapon a 1% chance to add death state and making your bosses 100% resistant to death state? Or am I missing something?

Edit: bgillisp makes an excellent point just below my post. Keep that in mind.
You know there is a really easy solution too. Just add the state state resist ko 0% to all bosses. Then instant KO will not work but they will still die from HP loss.

Important: Use state resist. Do not use state immune. State immune will cause them to never die. But state resist will not.
Couldn't this have simply been handled by giving your weapon a 1% chance to add death state and making your bosses immune to death state? Or am I missing something?

If I make them immune to death they are immortal... right?
Not if you use state rate 0% like I suggested.
Not if you use state rate 0% like I suggested.
Oh ok, i didn't read the edit.
Simpler solution.
Use this conditional branch in the formula.
Code:
b.enemy.note.include?("<boss>")
All you need to do is tagging the enemy with <boss> in its note box.

The entire formula is going to be like
Code:
if b.enemy.note.include?("<boss>"); a.atk * 4 - b.def * 2; elsif rand <= 0.1; b.add_state(1); 0; else; return a.atk * 4 - b.def * 2
It is a bit tricky to write in the damage formula.

Original thread: https://forums.rpgmakerweb.com/threads/new-idea-with-a-weapon.130889/