- Joined
- May 20, 2015
- Messages
- 140
- Reaction score
- 17
- First Language
- Greek
- Primarily Uses
- RMVXA
class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # Attack Forumla configuration ( Attack Bonus, Armor class, WeaponStats) #-------------------------------------------------------------------------- def custom_damage_formula (user, target) attackBonus = user.atk + user.agi rolledNumber = 1 + rand(20) + attackBonus @wpn_dmg = 1 + rand(3) # Enumerate user's weapons @wpn_dmg = 1 + rand(6) if user.weapons[1].wtype_id == 1 @wpn_dmg = 1 + rand(8) if user.weapons[1].wtype_id == 2 @wpn_dmg = 1 + rand(10) if user.weapons[1].wtype_id == 3 @wpn_dmg = 1 + rand(12) if user.weapons[1].wtype_id == 4 if user.weapons[1].wtype_id == 5 # Category with specials user.weapons.each { |wpn| case wpn.id when 1 # Hand Axe @wpn_dmg = (1 + rand(4)) when 2 # Battle Axe @wpn_dmg = (1 + rand(6)) when 3 # Bardiche @wpn_dmg = (1 + rand(8))# when X # Etc ...# @wpn_dmg = (1 + rand(X)) else # If weapon is none of the above @wpn_dmg = (1 + rand(5)) end } end #returns value if rolledNumber > target.def @custom_Formula_Result = @wpn_dmg else @custom_Formula_Result = 0 end return @custom_Formula_Result endendSo I have made this script and in a damage formula of attack I Use:
a.custom_damage_formula(a, However, in battle, No side can deal damage ( I am sure they can't since I have set their defence on 1 and atk on 110 while the characters def = 1 for testing. and atk = 110... )
Then when I comment out the section # Enumerate user's weapons.
I also have a problem .That only the monster's deal damage....
Can anyone point out where I might have made a mistake ????
EDIT:
For some reason it doesn't enter the Enumerate user's Weapons section and stops right there. Doesn't get to reach the return line...
Maybe something is wrong with this Syntax
@wpn_dmg = 1 + rand(6) if user.weapons[1].wtype_id == 1Since it ignores the lines afterwards....
As for when I commend out the Enumeration section , only when monsters attack it calls the method...
When the player attacks , it doesn't call it at all.
Actually either it is commended out or not, the playable character doesn;t call this method when he attacks...
a.custom_damage_formula(a, However, in battle, No side can deal damage ( I am sure they can't since I have set their defence on 1 and atk on 110 while the characters def = 1 for testing. and atk = 110... )
Then when I comment out the section # Enumerate user's weapons.
I also have a problem .That only the monster's deal damage....
Can anyone point out where I might have made a mistake ????
EDIT:
For some reason it doesn't enter the Enumerate user's Weapons section and stops right there. Doesn't get to reach the return line...
Maybe something is wrong with this Syntax
@wpn_dmg = 1 + rand(6) if user.weapons[1].wtype_id == 1Since it ignores the lines afterwards....
As for when I commend out the Enumeration section , only when monsters attack it calls the method...
When the player attacks , it doesn't call it at all.
Actually either it is commended out or not, the playable character doesn;t call this method when he attacks...
Last edited by a moderator:

