For example:
Code: Select all
Iron_Chestplate:
Defense_Normal = 10;
Defense_Fire = 2;
Defense_Lightning = 1;
Defense_Magic = 4;
Approach 1:
Using the actor property "DamageFactor". This seems the most straight forward and logical approach as damage calculation would continue to be handled automatically. However as far as I can tell, there's NO way to change an actor's "DamageFactor" during gameplay. You can only seem to change the "generic" DamageFactor which applies to all (?) "DamageTypes". So this won't allow for different elemental "DamageFactors".
Approach 2:
Using user_vars (decorate) and calculating damage manually. In order to do this, AAPTR_TARGET and AAPTR_PLAYER_GETTARGET have to be used to get the victim's information (even this i'm not sure how feasible that is). This seems simple enough for melee attacks but doesn't seem possible for projectiles, since they won't have a target to point to and get information from. (And I can't find any functions for getting an actor in a collision)
Note: I am only familiar with DECORATE and ACS, so my thoughts here only reflect the possibilities of those two features. I do not know enough about Zscript to say if there's a different approach.
If anyone has any ideas, thoughts or input, I'd greatly appreciate it.
EDIT: Forgot to mention, the goal here was to implement a 4 piece armor system. So I wanted to adjust the player actor's defensive values.
EDIT2: Thread has been solved. A viable method can be found below.