Ho bisogno di uno script che faccia in modo che il danno causato da oggetti e abilità sia uguale al danno stesso se il danno è > 20, e che sia uguale a 20 se il danno è < 20. Mi spiego meglio.
Se per esempio un'abilità di un personaggio (nemico o alleato) toglie 100, allora il danno complessivo sarà 100.
Ma se il danno è 15, o -100, o comunque < 20, il danno complessivo sarà 20.
Ho provato a modificare questo script, utilizzando una switch che quando è su off attiva il primo caso, con il danno > 20, quando è su on attiva l'altro, ovvero il danno = 20. Purtroppo non sono un bravo scripter (si dice così, giusto? ), ed è tutto il giorno che lavoro su questo script, ma l'unico risultato che ho ottenuto è questo:
class Game_Battler
def skills
for i in @skill.keys.sort
result.push($data_skill[i]) if @skill[i] > 0
skill = $data_skill[@skill_id]
unless skill.note.include?("*NODANNO")
if damage < 20
$game_switches[29] = true
else
$game_switches[29] = false
end
end
end
end
def make_obj_damage_value(user, obj)
damage = obj.base_damage # get base damage
if damage > 0 # a positive number?
damage += user.atk * 4 * obj.atk_f / 1 # Attack F of the user
damage += user.spi * 2 * obj.spi_f / 1 # Spirit F of the user
unless obj.ignore_defense # Except for ignore defense
damage -= self.def * 2 * obj.atk_f / 1 # Attack F of the target
damage -= self.spi * 1 * obj.spi_f / 1 # Spirit F of the target
end
damage = 0 if damage < 0 # If negative, make 0
elsif damage < 0 # a negative number?
damage -= user.atk * 4 * obj.atk_f / 1 # Attack F of the user
damage -= user.spi * 2 * obj.spi_f / 1 # Spirit F of the user
damage = 0
end
damage *= elements_max_rate(obj.element_set) # elemental adjustment
damage /= 100
damage = apply_variance(damage, obj.variance) # variance
damage = apply_guard(damage) # guard adjustment
if $game_switches[29] = true
damage = 0
end
if obj.damage_to_mp
@mp_damage = damage # damage MP
else
@hp_damage = damage # damage HP
end
end
end
Ciò che viene fuori è una battaglia in cui le abilità e gli oggetti dei personaggi non tolgono niente, anche se causano comunque danni quali veleno, sonno, ecc. Cosa ho sbagliato?
Un'altra cosa: è possibile creare abilità che infliggono sempre stati alterati e altre che le infliggono solo alcune volte?
Question
Mungò
Ho bisogno di uno script che faccia in modo che il danno causato da oggetti e abilità sia uguale al danno stesso se il danno è > 20, e che sia uguale a 20 se il danno è < 20. Mi spiego meglio.
Se per esempio un'abilità di un personaggio (nemico o alleato) toglie 100, allora il danno complessivo sarà 100.
Ma se il danno è 15, o -100, o comunque < 20, il danno complessivo sarà 20.
Ho provato a modificare questo script, utilizzando una switch che quando è su off attiva il primo caso, con il danno > 20, quando è su on attiva l'altro, ovvero il danno = 20. Purtroppo non sono un bravo scripter (si dice così, giusto?
), ed è tutto il giorno che lavoro su questo script, ma l'unico risultato che ho ottenuto è questo:
class Game_Battler def skills for i in @skill.keys.sort result.push($data_skill[i]) if @skill[i] > 0 skill = $data_skill[@skill_id] unless skill.note.include?("*NODANNO") if damage < 20 $game_switches[29] = true else $game_switches[29] = false end end end end def make_obj_damage_value(user, obj) damage = obj.base_damage # get base damage if damage > 0 # a positive number? damage += user.atk * 4 * obj.atk_f / 1 # Attack F of the user damage += user.spi * 2 * obj.spi_f / 1 # Spirit F of the user unless obj.ignore_defense # Except for ignore defense damage -= self.def * 2 * obj.atk_f / 1 # Attack F of the target damage -= self.spi * 1 * obj.spi_f / 1 # Spirit F of the target end damage = 0 if damage < 0 # If negative, make 0 elsif damage < 0 # a negative number? damage -= user.atk * 4 * obj.atk_f / 1 # Attack F of the user damage -= user.spi * 2 * obj.spi_f / 1 # Spirit F of the user damage = 0 end damage *= elements_max_rate(obj.element_set) # elemental adjustment damage /= 100 damage = apply_variance(damage, obj.variance) # variance damage = apply_guard(damage) # guard adjustment if $game_switches[29] = true damage = 0 end if obj.damage_to_mp @mp_damage = damage # damage MP else @hp_damage = damage # damage HP end end endCiò che viene fuori è una battaglia in cui le abilità e gli oggetti dei personaggi non tolgono niente, anche se causano comunque danni quali veleno, sonno, ecc. Cosa ho sbagliato?
Un'altra cosa: è possibile creare abilità che infliggono sempre stati alterati e altre che le infliggono solo alcune volte?
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now