I've scoured the internet for a couple days, hoping that someone had already made this, but I think the closest it got was with by Xelias in
http://forum.chaos-project.com/index.php?topic=5061.0. I'm brand new to rmxp and Ruby but think I have a good design that builds onto the ideas in that thread, specifically around the oil state and adjusting elemental efficacy. I'd like to run a few things by folks here to see if this is good/useful and I didn't see any way to do this with events. By all means, if this exists and I just suck at Googling, let me know. Also, if you guys have ideas on how this can be achieved through other means, let me know.
First, I'm looking for help in validating the approach/functional design before I go make a feeble attempt at scripting. Essentially, the user would configure states with elemental efficacy adjustments on top of the base enemy or actor-class. Although you can adjust efficacy up and down, my goal is weakness to elemental skills, so I'll speak in terms of making things more weak and less weak. I'd consider A to be the weakest (i.e. double damage) and F the least weak (i.e. absorb) but not sure if those numbers also play into the battler's attack. At any rate, to offer the most flexibility there would be 4 ways to adjust.
• Relative: + or - number of ranks i.e. adjust A - 3 = D or E + 2 = C, I know it's kind of backward
• Max: always set to A (200)
• Min: always set to F (-100)
• Override: enter whatever factor you want, knowing that 200 is double damage and -100 is absorb 100%. This is the one that I'm sort of scared of. It could be dangerous and I haven't dissected enough of the battle code to know the impact.
For user config, it would be a "database" where you'd enter the parameters as:
state_id, [[element_id1, operator1, value1],[element_id2, operator2, value2],...]
State and element IDs should be obvious. Operator is one of 4 adjustment values above: relative, max, min, and override. Value really only matters for relative and override. Override could be any integer and relative is only -5 to +5, skipping 0. If it's too hard to skip 0 then, it can be added but is kind of useless. For relative, to not exceed the boundaries of the game, I'd propose a hash table like this (sorry for the formatting, it looks better in .xls):
REL OLDA NEWA OLDB NEWB OLDC NEWC OLDD NEWDOLDE NEWE OLDF NEWF
+5 200->200 150->200 100->200 50-> 200 0-> 200 -100->200
+4 200->200 150->200 100->200 50-> 200 0-> 200 -100->150
+3 200->200 150->200 100->200 50-> 200 0-> 150 -100->100
+2 200->200 150->200 100->200 50-> 150 0-> 100 -100->50
+1 200->200 150->200 100->150 50-> 100 0-> 50 -100->0
-1 200->150 150->100 100->50 50-> 0 0-> -100 -100->-100
-2 200->100 150->50 100->0 50-> -100 0-> -100 -100->-100
-3 200->50 150->0 100->-100 50-> -100 0-> -100 -100->-100
-4 200->0 150->-100 100->-100 50-> -100 0-> -100 -100->-100
-5 200->-100 150->-100 100->-100 50-> -100 0-> -100 -100->-100
I think a new state_element_adjust type of class with a method for each operator would be created, but this is where I'm really not sure and could use some help.
Now for actually adjusting based on user configuration. Again, I'm not sure of the best way to implement as I think there are ways to extend the core classes and not go injecting code into them. However, to get the point across, we'd need the adjustment to happen after retrieving the base value and before halving the value due to state or armor (actor only) defense. This would need to happen in both the Game_Enemy and Game_Actor classes in the element_rate method. I'll use Game_Actor version, although Enemy is very similar.
#--------------------------------------------------------------------------
# * Get Element Revision Value
# element_id : element ID
#--------------------------------------------------------------------------
def element_rate(element_id)
# Get values corresponding to element effectiveness
table = [0,200,150,100,50,0,-100]
result = table[$data_classes[@class_id].element_ranks[element_id]]
# Adjust element effectiveness value, based on state
for i in @states
if $new_state_element_database.check_exists(element_id) #or something like that
when $new_state_element_database.element_id.operator 'max'
result = 200
when $new_state_element_database.element_id.operator 'min'
result = -100
when $new_state_element_database.element_id.operator 'override'
result = $new_state_element_database.element_id.value
when $new_state_element_database.element_id.operator 'relative'
result = #lookup relative_hashtable based on the relative value from our
#new database and the current "result" that came from the
#game's class database - implementing this hurts my brain
end
end # If this element is protected by armor, then it's reduced by half
for i in [@armor1_id, @armor2_id, @armor3_id, @armor4_id]......
I'm sure there are other things that are needed that I haven't thought through yet. I don't really know about error handling - like if someone configures a +6 or -6 relative value. This could probably be replicated for armor also, I just haven't thought that far ahead.
Anyway, while I intend to work on this at some point, I have yet to even create a game to test this on. If someone with scripting skills is interested in trying their hand at implementing this while I'm going back to the basics, I'd be grateful. I don't care about credit, just would like for something like this to exist. Of course any guidance or comments on the design is also very appreciated.