diff --git a/data/saland/spells/base_spells.json b/data/saland/spells/base_spells.json index 997512e..28f2689 100644 --- a/data/saland/spells/base_spells.json +++ b/data/saland/spells/base_spells.json @@ -9,6 +9,13 @@ "type": "dot" } ,{ + "name": "spell_watershot", + "icon": "effect_watershot", + "item_name": "", + "tile": 0, + "type": "dot" + } + ,{ "icon": "item_weapon_long_knife", "name": "weapon_slash_long_knife" } diff --git a/data/sprites/effects.sprite b/data/sprites/effects.sprite index c82f1f1..ec072b6 100644 --- a/data/sprites/effects.sprite +++ b/data/sprites/effects.sprite @@ -10,4 +10,16 @@ "originx" : 16, "originy" : 16 } +, +"effect_watershot" : { +"texture" : "effects/water_projectile", +"topx" : 0, +"topy" : 0, +"height" : 150, +"width" : 150, +"number_of_frames" : 1, +"frame_time" : 50, +"originx" : 75, +"originy" : 75 +} } \ No newline at end of file diff --git a/data/textures/effects/water_projectile.png b/data/textures/effects/water_projectile.png index 7edd034..3d71f1b 100644 Binary files a/data/textures/effects/water_projectile.png and b/data/textures/effects/water_projectile.png differ diff --git a/src/saland/Game.cpp b/src/saland/Game.cpp index 2256cc8..4b78efb 100644 --- a/src/saland/Game.cpp +++ b/src/saland/Game.cpp @@ -777,6 +777,23 @@ void Game::Update() { data->gameRegion.placeables.push_back(projectile); } } + if (data->spell_holder->slot_spell.at(data->spell_holder->slot_selected).name == "spell_watershot") { + if (data->human->castTimeRemaining == 0) { + data->human->castTimeRemaining = data->human->castTime; + data->human->animation = "spellcast"; + std::shared_ptr projectile = std::make_shared(); + projectile->sprite = "effect_watershot"; + projectile->X = data->human->X; + projectile->Y = data->human->Y; + projectile->Radius = 8.0f; + projectile->directionX = projectile->X - data->world_mouse_x; + projectile->directionY = projectile->Y - data->world_mouse_y; + projectile->damage.fire = 10.0f; + SetLengthToOne(projectile->directionX, projectile->directionY); + projectile->fired_by = data->human; + data->gameRegion.placeables.push_back(projectile); + } + } if (data->spell_holder->slot_spell.at(data->spell_holder->slot_selected).name == "spell_spawn_item") { if (data->human->castTimeRemaining == 0) { data->human->castTimeRemaining = data->human->castTime;