Posts: 14
Threads: 3
Joined: Apr 2010
10-24-2010, 03:37 PM
(This post was last modified: 10-24-2010, 07:21 PM by corpsegirl.)
I didn't see any better section to ask about this. How do I change the default battle system in the following ways
Evasion (chance to be missed) = Agi + Dex +50
Accuracy (chance to peirce evasion) = Dex + Int
Chance to evade = Target's Evasion - Attacker's Accuracy
Posts: 550
Threads: 62
Joined: May 2009
You would have to edit this by script, somewhere in the calculation of those >.<
question, why? why would you want to do this?
its not like the player will use one set of armor for the rest of his life...
eg. rookie armor = 1% eva
learned how to write a webpage armor = 5% eva
wizkid divine wind armor ^^ = 100% eva
anyway, u can get the same result without touching those scary lines of code @>@
or search through the forum for a script.
Posts: 14
Threads: 3
Joined: Apr 2010
This makes an evasion system rather than a damage reduction system. It makes stats leveling up function smoother. And there is no 100% evade since attacker accuracy reduces the evade in the formula. its an accuracy score not an accuracy flat percent.
Posts: 1,019
Threads: 76
Joined: Jan 2010
Go into the Battler1 script. Here you will find methods for things like evade. Messing around there should be able to achieve what you wanna do.
Valdred
Tech Administrator of Save-Point
Posts: 14
Threads: 3
Joined: Apr 2010
10-24-2010, 05:54 PM
(This post was last modified: 10-24-2010, 07:30 PM by corpsegirl.)
I tried looking at it but none of the terms I used seemed to work. I'm not sure how to call the stats an do math to them.
Code:
def hit
n = 100
for i in @states
n *= $data_states[i].hit_rate / 100.0
end
return Integer(n)
end
I think tahts what I need to change. how do I call a stat + a stat? I'm not sure what the line n *= $data_states[i].hit_rate / 100.0 is doing.
maybe I should be lookign in game battler 3 in this section instead?
Code:
#--------------------------------------------------------------------------
# First hit detection
hit_result = (rand(100) < attacker.hit)
# If hit occurs
if hit_result == true
I need I need hit_result to be
Code:
hit_result ((rand(100)) < (50 + (def stat + def stat) - (att stat + att stat) + element bonus/penalty)
so say both def stats are 10 and both att stats are 5 that total is 60 rand needs to be 60 or less to hit. I'm not sure how to call the stats for the formula.
*From DerVV: I just wrapped your script samples in CODE bbcode.
Thanks. I should have used the,. Sorry for the inconvenience.
Posts: 14
Threads: 3
Joined: Apr 2010
Error on line 90.
Code:
#--------------------------------------------------------------------------
# * Applying Normal Attack Effects
# attacker : battler
#--------------------------------------------------------------------------
def attack_effect(attacker)
# Clear critical flag
self.critical = false
# First hit detection
hit_result = ((rand(100)) < ((50 + (self.agi + self.dex) - (attacker.dex + attacker.int))
hit = self.cant_evade? ? 100 : hit
# If hit occurs
if hit_result == true
# Calculate basic damage
min = [attacker.atk + attacker.str + attacker.int]
max = [attacker.atk + attacker.str + attacker.str]
atk = (rand(max - min) + min)
self.damage = atk
# Element correction
self.damage *= elements_correct(attacker.element_set)
self.damage /= 100
# If damage value is strictly positive
if self.damage > 0
# Critical correction
if rand(100) < (attacker.agi + attacker.int)
self.damage *= (((attacker.str + attacker.int + attacker.agi)/100)+1)
self.critical = true
end
# Guard correction
if self.guarding?
self.damage /= 2
end
end
end
# If hit occurs
if hit_result == true
# State Removed by Shock
remove_states_shock
# Substract damage from HP
self.hp -= self.damage
# State change
@state_changed = false
states_plus(attacker.plus_state_set)
states_minus(attacker.minus_state_set)
# When missing
else
# Set damage to "Miss"
self.damage = "Miss"
# Clear critical flag
self.critical = false
end
# End Method
return true
end
Posts: 550
Threads: 62
Joined: May 2009
hmm... u might wanna clearly indicate which line is line 90.
btw, double posting is "bad" and i dont mean good ^^ (kids these days)
Posts: 14
Threads: 3
Joined: Apr 2010
Ah. sorry about the double post. The last line of the code is the line in question.
Posts: 1,019
Threads: 76
Joined: Jan 2010
Add another
on the next line.
Valdred
Tech Administrator of Save-Point
Posts: 11,228
Threads: 648
Joined: May 2009
And add
in front as the first line
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Above are clickable links