PhotonWeapon
Member
[No message]
def base_hit
### PhotonWeapon Note:
### There's actually no base_hit by default; I added this myself.
### This script will give each hero their own hit% depending on
### the weapon they have equipped via case statement.
### First, we'll set default_hit_rate = whatever. This makes it so that
### the hero's default hit rate is always the value of default_hit_rate
### until they equip a certain weapon. This is so that you don't have
### to make a case statement for every single weapon in the game;
### just the ones you'd want to change the hit% for when equipped.
### NOTE: 90% is the default hit rate in RM2K/3; 100% is the default
### hit rate in RMXP. Up to you which one you choose.
default_hit_rate = 90
hit_rate = default_hit_rate
case @weapon_id ### If equipped with certain weapon (by its ID# in Database)
when 10 ### Bronze Axe
hit_rate = 85
when 11 ### Iron Axe
hit_rate = 85
when 12 ### Steel Axe
hit_rate = 85
when 13 ### Mythril Axe
hit_rate = 85
when 21 ### Bronze Gun
hit_rate = 95
when 22 ### Iron Gun
hit_rate = 95
when 23 ### Steel Gun
hit_rate = 95
when 24 ### Mythril Gun
hit_rate = 95
end
### PhotonWeapon Note:
### This checks to see if the hero has no weapon equipped.
### If the hero doesn't have any weapon equipped, their hit%
### becomes the default_hit_rate. Not that it would matter
### much, since they'll just deal 0 damage, unless
### you do something about the default Attack Power script.
weapon = $data_weapons[@weapon_id]
hit_rate = weapon != nil ? hit_rate : default_hit_rate
return hit_rate
end
def base_hit
case @weapon_id ### If equipped with certain weapon (by its ID# in Database)
when 10 ### Bronze Axe
hit_rate = 85
when 11 ### Iron Axe
hit_rate = 85
when 12 ### Steel Axe
hit_rate = 85
when 13 ### Mythril Axe
hit_rate = 85
when 21 ### Bronze Gun
hit_rate = 95
when 22 ### Iron Gun
hit_rate = 95
when 23 ### Steel Gun
hit_rate = 95
when 24 ### Mythril Gun
hit_rate = 95
else ## The Default
hit_rate = 90
end
return hit_rate
end
class Game_Actor
Weapon_Hit_Rates = {10 => 85, 11 => 85, 12 => 85, 13 => 85, 21 => 95, 22 => 95, 23 => 95, 24 => 95}
Weapon_Hit_Rates.default = 90
def base_hit
return Weapon_Hit_Rates[@weapon_id]
end
end
### PhotonWeapon Note:
### I've editted the critical hit rate. Dexterity now = Critical Hit %.
### First, subtract Dex by 1; that way, if the attacker's
### Dex is 1, it becomes 0 (no chance of criticals).
### Of course, this means you need their Dex
### set to 2 to give them a 1% critical chance (2Dex - 1 = 1), and set
### to 101 to give them a 100% critical chance (101Dex - 1 = 100).
### After that, if their Dex is greater than or equal to 101,
### have it equal 100 (or 100%).
attacker.dex - 1
if attacker.dex >= 101
attacker.dex = 100
end
Trickster;256675 said:OK a few tips on getting better
1) do not post the whole class if someone where to add that it may overwrite another script, just include it as one script (single script) with only the methods you modify/alias
2) instead of this
<snip, snip and snip, don't wanna make the quote too long now>
But yeah my preference is with the hash setup rather than using a big long case statement but it is up to you
3)
You didn't subtract dex by 1
Also it would have been better if you had created another stat for critical hit % and rate
but yeah the big problem is that you are posting whole classes instead of just methods you edited as most of the code you posted is unnecessary.
Also. your scripts do not conflict in any way with SDK. SDK overwrites Game_, Scene_, and Sprite_ classes and Game_Battler, and Game_Enemy were not split up. The only method that was split in Game_Actor was exp= so there aren't any problems.
overall, good job.
The Wizard;256691 said:I'm liking the idea Photon Weapon, good work. Just one question about your hit% script, is the overall chance to hit the hit% - evasion% or is it the hit% - the default way of calculating a hit?