Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 1 post ] 
    SPN
  Wed Mar 09, 2011 3:38 am
Lemon Meringue Pie
User avatar
Member


Location: Canada
Hey guys, I just finished ironing out the bugs after doing some edits to the default damage formulas and whatnot. I'm definitely no scripter, but after some digging, I found the lines I needed, and made the necessary adjustments until things were working how I wanted them.

Overall, it expands your skill options a bit, and definitely makes things easier to calculate.

Notes:
  • This is meant for the Default Battle System in RMXP.
  • Some of the script work might be a bit ugly. Me not being a scripter is fully to blame. Feel free to criticize (:
  • Magic Defense reductions have not been fully tested. After testing PDef, I presumed MDef would work as well.
  • No credit is needed, as this is just a small edit done by a non-scripter.


All right, so here's what I've done:

Standard Attack
For standard attacks, the Attack stat is the base damage, so a sword with 10 Atk would give you 10 damage. Strength affects your base damage by adding it to itself for every 100 Str. So, 100 Str would double your base damage, 200 would triple, 300 would quadruple, etc. Standard stats go up to 999, and 900 Str would increase your base damage by 10x.

Physical Defense of the target reduces damage dealt linearly after all calculations, but before Critical Hits and Guarding. So, a 10 Atk sword with 100 Str against a target with 5 PDef would do the following:

Base Damage = Attack * (100 + Strength) / 100
Base Damage = 10 * (100 + 100) / 100
Base Damage = 10 * 200 / 100
Base Damage = 2000 / 100
Base Damage = 20

Damage = Base Damage - Physical Defense
Damage = 20 - 5
Damage = 15

Critical Hits and Guarding were moved to the end of the calculations, so you take the final damage to be dealt, THEN adjust, giving you as close to doubling and halving as possible.

Skills
This was a bit trickier, but I believe it adds a lot more options to making different skill types and whatnot. Originally, you had to set a base power for the skill and work off of that. Now, if you set the Attack-F (Atk influence) to 0, skills still work normally. But if you set the Atk-F to anything else (1-100) you get skills that base their damage off of your actual Attack stat, ignoring the skill power completely.

You might be asking yourself how this helps at all. Its best use is to make skills that are based off of only the Attack stat, and not the skill power. So if you wanted a skill that always did around double of whatever a standard attack would do, now you can. This makes long-term balancing of skills vs. attacks so much easier, since your Attack stat would always be increasing, but the skill power was always constant.

I've set the Attack-F to influence damage in a certain way, but it is very easily modifiable.

*checks to see if Attack-F is over 0*
Skill Power = Attack * Skill Attack-F / 10

So, if Attack-F is set to 10, the skill power equals your Attack stat (which equals a standard attack). If set to 5 for example, the skill's damage will be equal to 50% of a standard attack. Setting to 20 gives you double, 50 gives you 5x, etc.

The script then checks for the standard rates, so if Strength-F is 100, it will influence the base damage the same way it would for a standard attack. The same applies for the other stats. It then checks to see if either the PDefense-F or the MDefense-F are above 0. If one is set to 100, it reduces linearly like it would for standard attacks. Setting to 50 would reduce by 1 for every 2 in the respective stat, 25 would be 1 for every 4, etc.

The drawback of setting up the rates this way is that having a skill affected by more than one stat, and both defenses makes things messy, so it's ideal for single type, single stat-based skills.

I think that about covers it, sorry for the essay, here's the script. Just replace Game_Battler 3 entirely with this:
Expand to see the code.


It was exciting actually making this work myself. If you have any questions or comments, I'd be more than happy to read them (:

Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


Who is online

Users browsing this forum: No users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group