Skip to content

Commit

Permalink
Merge pull request #961 from dorkster/effects
Browse files Browse the repository at this point in the history
Allow for arbitrary buff/debuff visuals
  • Loading branch information
clintbellanger committed Sep 12, 2012
2 parents 80bba46 + 3a7bef9 commit 93368c3
Show file tree
Hide file tree
Showing 11 changed files with 266 additions and 168 deletions.
23 changes: 12 additions & 11 deletions mods/fantasycore/engine/effects.txt
@@ -1,11 +1,12 @@
# hazard settings
frame_size=64,64
frame_offset=32,32

# shield effect
frame_size_sh=0,0,128,128
frame_offset_sh=64,96

# vengeance effect
frame_size_veg=0,128,64,64
frame_offset_veg=32,32
# hazard settings
frame_size=64,64
frame_offset=32,32

# status effects
id=1
type=shield
gfx=shield.png
size=0,0,128,128
offset=64,96
frame_total=12
ticks_per_frame=3
11 changes: 0 additions & 11 deletions mods/fantasycore/powers/powers.txt
Expand Up @@ -198,7 +198,6 @@ icon=11
description=Create a force field that absorbs damage
new_state=cast
requires_mp=1
gfx=shield.png
sfx=shield.ogg
buff_shield=true

Expand Down Expand Up @@ -302,16 +301,6 @@ base_damage=ranged
aim_assist=32
allow_power_mod=true

[power]
id=17
name=Vengeance
icon=17
description=After blocking, unleash a deadly and accurate counter-attack
new_state=swing
face=true
requires_mp=1


[power]
id=18
name=Burn
Expand Down
23 changes: 12 additions & 11 deletions mods/minicore/engine/effects.txt
@@ -1,11 +1,12 @@
# hazard settings
frame_size=32,32
frame_offset=16,16

# shield effect
frame_size_sh=0,0,64,64
frame_offset_sh=32,48

# vengeance effect
frame_size_veg=0,64,32,32
frame_offset_veg=16,16
# hazard settings
frame_size=32,32
frame_offset=16,16

# status effects
id=1
type=shield
gfx=shield.png
size=0,0,64,64
offset=32,48
frame_total=12
ticks_per_frame=3
133 changes: 94 additions & 39 deletions mods/minicore/powers/powers.txt
@@ -1,17 +1,5 @@
# Power Definitions

[power]
id=0
name=Shoot
type=missile
icon=0
description=Basic ranged attack
new_state=shoot
face=true
requires_offense_weapon=true
base_damage=ranged
aim_assist=32
allow_power_mod=true
# Do not change power with id=136 called Disenchant

[power]
id=1
Expand All @@ -35,7 +23,7 @@ id=2
name=Channel
type=missile
icon=2
description=Channel a bolt of magic through your mental weapon for zero MP
description=Basic magic attack
new_state=swing
requires_mental_weapon=true
face=true
Expand Down Expand Up @@ -159,7 +147,7 @@ requires_mp=1
multitarget=true
base_damage=ranged
aim_assist=32
trait_armor_penetrating=true
trait_armor_penetration=true
allow_power_mod=true

[power]
Expand Down Expand Up @@ -210,7 +198,6 @@ icon=11
description=Create a force field that absorbs damage
new_state=cast
requires_mp=1
gfx=shield.png
sfx=shield.ogg
buff_shield=true

Expand Down Expand Up @@ -270,7 +257,7 @@ delay=3
visual_random=3
rendered=true
complete_animation=true
repeater_num=10
count=10

[power]
id=15
Expand Down Expand Up @@ -306,24 +293,14 @@ icon=16
description=Shoot three projectiles simultaneously
new_state=shoot
face=true
missile_num=3
count=3
missile_angle=15
requires_offense_weapon=true
requires_mp=1
base_damage=ranged
aim_assist=32
allow_power_mod=true

[power]
id=17
name=Vengeance
icon=17
description=After blocking, unleash a deadly and accurate counter-attack
new_state=swing
face=true
requires_mp=1


[power]
id=18
name=Burn
Expand Down Expand Up @@ -351,7 +328,6 @@ active_frame=4
trait_elemental=fire
starting_pos=target
multitarget=true
post_effect=40
post_power=125
range=512

Expand All @@ -372,6 +348,82 @@ multitarget=true
stun_duration=150
base_damage=none

[power]
id=20
name=Heroic Swing
type=effect
icon=1
description=Melee attack with 10% HP steal
new_state=swing
face=true
use_hazard=true
rendered=false
aim_assist=32
base_damage=melee
lifespan=1
radius=64
starting_pos=melee
allow_power_mod=true
hp_steal=10

[power]
id=21
name=Greater Channel
type=missile
icon=2
description=Magic attack with 10% MP steal
new_state=swing
requires_mental_weapon=true
face=true
directional=true
gfx=channel.png
use_hazard=true
rendered=true
aim_assist=32
base_damage=ment
lifespan=8
radius=64
speed=24
frame_loop=0
frame_duration=2
frame_size=32,32
frame_offset=16,32
starting_pos=melee
mp_steal=10

[power]
id=22
name=Shoot
type=missile
icon=0
description=Basic ranged attack
new_state=shoot
face=true
requires_offense_weapon=true
base_damage=ranged
starting_pos=melee
aim_assist=32
allow_power_mod=true

[power]
id=23
name=Rapid Fire
type=missile
icon=0
description=Fire five low power missiles in quick succession
new_state=shoot
face=true
requires_offense_weapon=true
requires_mp=5
base_damage=ranged
starting_pos=melee
aim_assist=32
allow_power_mod=true
count=5
delay=2
damage_multiplier=66
cooldown=5000

[power]
id=30
name=Ice Shard [enemy]
Expand Down Expand Up @@ -526,7 +578,7 @@ slow_duration=60
post_power=126
wall_power=126
#missile num needs to be odd, or the player can avoid just by standing there
missile_num=9
count=9
missile_angle=40

[power]
Expand Down Expand Up @@ -599,7 +651,7 @@ lifespan=1
radius=64
starting_pos=melee
allow_power_mod=true
trait_armor_penetrating=true
trait_armor_penetration=true

[power]
id=40
Expand Down Expand Up @@ -627,7 +679,6 @@ active_frame=4
trait_elemental=fire
starting_pos=source
multitarget=true
post_effect=40
post_power=125

# paralyzing spit
Expand Down Expand Up @@ -679,7 +730,7 @@ speed=48
frame_size=32,32
frame_offset=16,32
wall_power=124
missile_num=3
count=3
missile_angle=15

[power]
Expand All @@ -688,39 +739,43 @@ type=effect
icon=32
name=Health Potion
sfx=potion.ogg
new_state=cast
new_state=instant
requires_item=1
buff_restore_hp=25
cooldown=600

[power]
id=101
type=effect
icon=33
name=Mana Potion
new_state=cast
new_state=instant
sfx=potion.ogg
requires_item=2
buff_restore_mp=25
cooldown=600

[power]
id=102
type=effect
icon=34
name=Health Flask
sfx=potion.ogg
new_state=cast
new_state=instant
requires_item=3
buff_restore_hp=75
cooldown=600

[power]
id=103
type=effect
icon=35
name=Mana Flask
new_state=cast
new_state=instant
sfx=potion.ogg
requires_item=4
buff_restore_mp=75
cooldown=600


[power]
Expand Down Expand Up @@ -772,7 +827,7 @@ trait_elemental=wind
post_power=126
wall_power=126
requires_item=1021
missile_num=5
count=5
angle_variance=15
speed_variance=7

Expand Down Expand Up @@ -1150,7 +1205,7 @@ delay=6
visual_random=4
rendered=true
complete_animation=true
repeater_num=10
count=10

[power]
id=160
Expand Down
7 changes: 0 additions & 7 deletions src/Avatar.cpp
Expand Up @@ -783,13 +783,6 @@ bool Avatar::takeHit(Hazard h) {
powers->activate(h.post_power, h.src_stats, stats.pos);
}

// Power-specific: Vengeance gains stacks when blocking
if (stats.blocking && stats.physdef >= 9) {
if (stats.vengeance_stacks < 3)
stats.vengeance_stacks++;
}


if (stats.hp <= 0) {
stats.cur_state = AVATAR_DEAD;

Expand Down
8 changes: 4 additions & 4 deletions src/EnemyManager.cpp
Expand Up @@ -298,11 +298,11 @@ void EnemyManager::addRenders(vector<Renderable> &r, vector<Renderable> &r_dead)
// draw corpses below objects so that floor loot is more visible
bool dead = (*it)->stats.corpse;
(dead ? r_dead : r).push_back(re);
if ((*it)->stats.shield_hp > 0) {
re = (*it)->stats.getEffectRender(STAT_EFFECT_SHIELD);
re.sprite = powers->gfx[powers->powers[POWER_SHIELD].gfx_index]; // TODO: parameter
(dead ? r_dead : r).push_back(re);
if ((*it)->stats.shield_hp == 0) {
(*it)->stats.removeEffect("shield");
}
re = powers->renderEffects(&(*it)->stats);
(dead ? r_dead : r).push_back(re);
}
}

Expand Down
13 changes: 4 additions & 9 deletions src/GameStatePlay.cpp
Expand Up @@ -633,16 +633,11 @@ void GameStatePlay::render() {
rens.push_back(pc_hero); // Avatar

// get additional hero overlays
if (pc->stats.shield_hp > 0) {
Renderable re = pc->stats.getEffectRender(STAT_EFFECT_SHIELD);
re.sprite = powers->gfx[powers->powers[POWER_SHIELD].gfx_index]; // TODO: parameter
rens.push_back(re);
}
if (pc->stats.vengeance_stacks > 0) {
Renderable re = pc->stats.getEffectRender(STAT_EFFECT_VENGEANCE);
re.sprite = powers->runes;
rens.push_back(re);
if (pc->stats.shield_hp == 0) {
pc->stats.removeEffect("shield");
}
Renderable re = powers->renderEffects(&pc->stats);
rens.push_back(re);

enemies->addRenders(rens, rens_dead);

Expand Down

0 comments on commit 93368c3

Please sign in to comment.