Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this doesn't handle multiple instances of debuffs
- updateEnemy()
- {
- if(enemy->storedBurn.base > 0)
- {
- enemy->currentHealth -= calculateStat(enemy->storedBurn);
- }
- if(enemy->storedChill.base > 0)
- {
- enemy->movementSpeed *= 1.0f - calculateStat(enemy->storedChill);
- }
- }
- whenAttackHitsEnemy(...)
- {
- if(attack->type == FIRE_ATTACK_TYPE)
- {
- enemy->storedBurn = attackSource.damageStat + attackSource.burnStat;
- enemy->storedBurn.more *= BURN_DAMAGE_PERCENT_PER_SECOND;
- }
- if(attack->type == COLD_ATTACK_TYPE)
- {
- // This assumes that damage doesn't affect chill effect
- enemy->storedChill = attackSource.chillEffect;
- enemy->storedChill.base += 1;
- enemy->storedChill.more *= BASE_CHILL_EFFECT;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement