DDKL
09-05-2009, 06:00 PM
Fiddlin' around with the games data files I came across the code for valkyrie's javelin and this interesting section within it.
<damage effecttype="Magic" amount="90,180,270,360" />
<condition test="distance lt 300" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="500"/>
</condition>
<condition test="distance ge 300" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="1000"/>
</condition>
<condition test="distance ge 450" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="1500"/>
</condition>
<condition test="distance ge 600" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="2000"/>
</condition>
<condition test="distance ge 750" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="2500"/>
</condition>
<condition test="distance ge 900" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="3000"/>
</condition>
<condition test="distance ge 1050" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="3500"/>
</condition>
<condition test="distance ge 1300" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="4000"/>
</condition>
<condition test="distance ge 1450" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="4500"/>
</condition>
<condition test="distance ge 1500" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="5000"/>
</condition>
There are a few curious things there. First one being the way the ability has been coded; why not use a simple function instead of such horrendously large and unnecesarily complicated wall of text? Stuntime = distance/300 would allow for much more precision and simplicity.
Edit: Actually the target- and proxy-entity dependent script could be replaced with one that calculates the distance based on the time javelin has existed.
The second curiosity regards the distance dependency. The four last values are 1050, 1300, 1450, 1500. (250, 150, 50 being the differences) So what I'm wondering is wether this is just a mistake or is it intentional?
<damage effecttype="Magic" amount="90,180,270,360" />
<condition test="distance lt 300" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="500"/>
</condition>
<condition test="distance ge 300" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="1000"/>
</condition>
<condition test="distance ge 450" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="1500"/>
</condition>
<condition test="distance ge 600" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="2000"/>
</condition>
<condition test="distance ge 750" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="2500"/>
</condition>
<condition test="distance ge 900" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="3000"/>
</condition>
<condition test="distance ge 1050" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="3500"/>
</condition>
<condition test="distance ge 1300" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="4000"/>
</condition>
<condition test="distance ge 1450" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="4500"/>
</condition>
<condition test="distance ge 1500" source="target_entity" target="proxy_entity">
<applystate name="State_Stunned" duration="5000"/>
</condition>
There are a few curious things there. First one being the way the ability has been coded; why not use a simple function instead of such horrendously large and unnecesarily complicated wall of text? Stuntime = distance/300 would allow for much more precision and simplicity.
Edit: Actually the target- and proxy-entity dependent script could be replaced with one that calculates the distance based on the time javelin has existed.
The second curiosity regards the distance dependency. The four last values are 1050, 1300, 1450, 1500. (250, 150, 50 being the differences) So what I'm wondering is wether this is just a mistake or is it intentional?