collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
884 stars 101 forks source link

add support for item by-time stats #20

Open collinsmith opened 5 years ago

collinsmith commented 5 years ago

Game files support time-of-day stats that I don't think were ever implemented (or at least items with those stats don't appear to drop). I'm not going to support them for now, but maybe they can be supported later. Maybe it would be cool to add some kind of druid item that gives stats at night?

See ItemStatCost.txt

item_armor_bytime
item_armorpercent_bytime
item_hp_bytime
item_mana_bytime
item_maxdamage_bytime
item_maxdamage_percent_bytime
item_strength_bytime
item_dexterity_bytime
item_energy_bytime
item_vitality_bytime
item_tohit_bytime
item_tohitpercent_bytime
item_cold_damagemax_bytime
item_fire_damagemax_bytime
item_ltng_damagemax_bytime
item_pois_damagemax_bytime
item_resist_cold_bytime
item_resist_fire_bytime
item_resist_ltng_bytime
item_resist_pois_bytime
item_absorb_cold_bytime
item_absorb_fire_bytime
item_absorb_ltng_bytime
item_absorb_pois_bytime
item_find_gold_bytime
item_find_magic_bytime
item_regenstamina_bytime
item_stamina_bytime
item_damage_demon_bytime
item_damage_undead_bytime
item_tohit_demon_bytime
item_tohit_undead_bytime
item_crushingblow_bytime
item_openwounds_bytime
item_kick_damage_bytime
item_deadlystrike_bytime
item_find_gems_bytime
collinsmith commented 5 years ago

I added support for by-time formatting -- untested.

collinsmith commented 5 years ago

I've noticed before that the bit counts for this specific encoding (encoding 4) seemed incorrect compared to the other encodings. It seems logical that param=2 bits, value=20 bits because time-of-day is what makes each by-time encoding unique and the ranges are the value. I wrote a small modification to ItemStatCost to manually fix this behavior for all encoding=4 rows.