Eccma wants a skill json sample you used for this since he is thinking of making this official if it works properly.
Viewing post in Code that allow to use "compare" in skill's "cost".
For example.
{
"item_name": "FireN",
"message2":"",
"description":"",
"name":"FireN",
"occasion":0,
"icon_index":680,
"message1":"",
"scope":1,
"animation_id":0,
"tag_main_settings":{"tag":"FireN","flag":"FireN","type":"other"}
"mp_cost":0,
"speed":0,
"features":[],
"effects":[],
"type":0,
"element_id":0,
"formula":"0",
"variance":20,
"critical":false,
"success_rate":100,
"hit_type":0,
"stype_id":1,
"tp_cost":0,
"required_wtype_id1":0,
"required_wtype_id2":0,
"repeats":1,
"tp_gain":0,
"textFlag": {
"folder": "Text",
"name": "DataSkill:FireStaffNormal/item_name",
"description": "DataSkill:FireStaffNormal/description"
},
"CHS_animation": "animation_casting_mh_long",
"wait_hit_frame": true,
"range": 5,
"back_stab":1,
"stealth": false,
"hit_frame":10,
"summon_user": "EffectCastingFireMagic",
"summon_hold": "EffectFireMagicShortHold",
"summon_hit": "FireBallMissileProjectile",
"no_parry":true,
"no_dodge":false,
"sap":false,
"hold_type": "energizing",
"hold_animation": "animation_hold_casting_mh",
"hit_detection":"Missile",
"projectile_type": 1,
"effect_since" : 5,
"launch_since" : 30,
"launch_max" : 31,
"ai_value": {
"assulter": 100,
"killer": 100,
"fucker": 100
},
"cost": [{
"base": {
"attribute_name": "sta",
"attribute_type": "current",
"adjustor": "-",
"adjustment": "4",
"lowest_req" : "0",
"highest_req" : "65535"
},
"compare": {
"attribute_name": "wisdom_trait",
"attribute_type": "current",
"adjustor": "*",
"adjustment": "-0.02"
}
},{
"base": {
"attribute_name": "mood",
"attribute_type": "current",
"adjustor": "-",
"adjustment": "1",
"lowest_req" : "-200",
"highest_req" : "65535"
},
"compare": {
"attribute_name": "wisdom_trait",
"attribute_type": "current",
"adjustor": "*",
"adjustment": "-0.01"
}
}],
"effect": [],
"add_state": [],
"hit_gate": "-1",
"hit_chance": []
}
But, now, i think only about "-" or "+" in code and in json files.
What type will be more useful?
—
1)
def process_skill_cost(skill):
cost_val = get_affected_attr(cost.base) - get_affected_attr(cost.compare)
def process_skill_cost_reverse(skill):
cost_val2= cost_val1 - ( get_affected_attr(cost.base) - get_affected_attr(cost.compare) )
OR:
2)
def process_skill_cost(skill):
cost_val = get_affected_attr(cost.base) + get_affected_attr(cost.compare)
def process_skill_cost_reverse(skill):
cost_val2= cost_val1 - ( get_affected_attr(cost.base) + get_affected_attr(cost.compare) )
—
Json code above will propertly works with 1).
If use 2) ruby-code, i will need to use "0.02" ("0.01" for mood) instead of "-0.02" ("-0.01" for mood) in compare with wisdom_trait to decrease cost.
It's just a matter of convenience. Eccma can decide for himself which option he likes best.