homing projectiles + wizard spell (#21752)

This commit is contained in:
Charlie
2023-07-24 15:52:17 +01:00
committed by GitHub
parent 907ee1abd1
commit 5ccd8241c4
6 changed files with 70 additions and 1 deletions

View File

@@ -358,6 +358,16 @@
return TRUE
/obj/effect/proc_holder/spell/fireball/toolbox
name = "Homing Toolbox"
desc = "This spell summons and throws a magical homing toolbox at your opponent."
sound = 'sound/weapons/smash.ogg'
fireball_type = /obj/item/projectile/homing/magic/toolbox
invocation = "ROBUSTIO!"
selection_activated_message = "<span class='notice'>Your prepare to cast your homing toolbox! <B>Left-click to cast at a target!</B></span>"
selection_deactivated_message = "<span class='notice'>You unrobust your toolbox...for now.</span>"
/obj/effect/proc_holder/spell/aoe/repulse
name = "Repulse"
desc = "This spell throws everything around the user away."

View File

@@ -137,6 +137,12 @@
spell_type = /obj/effect/proc_holder/spell/fireball
category = "Offensive"
/datum/spellbook_entry/summon_toolbox
name = "Homing Toolbox"
spell_type = /obj/effect/proc_holder/spell/fireball/toolbox
category = "Offensive"
cost = 1
/datum/spellbook_entry/fleshtostone
name = "Flesh to Stone"
spell_type = /obj/effect/proc_holder/spell/touch/flesh_to_stone

View File

@@ -578,7 +578,6 @@ emp_act
if(((throwingdatum ? throwingdatum.speed : I.throw_speed) >= EMBED_THROWSPEED_THRESHOLD) || I.embedded_ignore_throwspeed_threshold)
if(can_embed(I))
if(prob(I.embed_chance) && !HAS_TRAIT(src, TRAIT_PIERCEIMMUNE))
throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
var/obj/item/organ/external/L = pick(bodyparts)
L.add_embedded_object(I)
I.add_mob_blood(src)//it embedded itself in you, of course it's bloody!

View File

@@ -0,0 +1,52 @@
/obj/item/projectile/homing
name = "smart bullet"
icon_state = "bullet"
var/homing_active = TRUE
/obj/item/projectile/homing/pixel_move(trajectory_multiplier)
. = ..()
if(!homing_active)
return
var/turf/current_turf = get_turf(src)
var/turf/target_turf = get_turf(original)
if(current_turf == target_turf)
homing_active = FALSE
return
if(!current_turf || !target_turf)
return
var/dx = target_turf.x - current_turf.x
var/dy = target_turf.y - current_turf.y
var/angle = ATAN2(dy, dx)
set_angle(angle)
/obj/item/projectile/homing/magic
name = "bolt of nothing"
icon_state = "energy"
damage = 0
damage_type = OXY
nodamage = 1
armour_penetration_percentage = 100
flag = MAGIC
/obj/item/projectile/homing/magic/toolbox
name = "magic toolbox"
icon = 'icons/obj/storage.dmi'
icon_state = "toolbox_default"
hitsound = 'sound/weapons/smash.ogg'
damage = 30
damage_type = BRUTE
/obj/item/projectile/homing/magic/toolbox/on_range()
. = ..()
new /obj/item/storage/toolbox(get_turf(src))
/obj/item/projectile/homing/magic/toolbox/on_hit(atom/target, blocked, hit_zone)
. = ..()
var/obj/item/storage/toolbox/T = new /obj/item/storage/toolbox(get_turf(src))
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/obj/item/organ/external/E = pick(H.bodyparts)
E.add_embedded_object(T)

View File

@@ -871,6 +871,7 @@ Note that amputating the affected organ does in fact remove the infection from t
forceMove(T)
/obj/item/organ/external/proc/add_embedded_object(obj/item/I)
owner.throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
embedded_objects += I
I.forceMove(owner)
RegisterSignal(I, COMSIG_MOVABLE_MOVED, PROC_REF(remove_embedded_object))

View File

@@ -2405,6 +2405,7 @@
#include "code\modules\projectiles\projectile\bullets.dm"
#include "code\modules\projectiles\projectile\energy_projectiles.dm"
#include "code\modules\projectiles\projectile\force.dm"
#include "code\modules\projectiles\projectile\homing_projectiles.dm"
#include "code\modules\projectiles\projectile\magic_projectiles.dm"
#include "code\modules\projectiles\projectile\reusable.dm"
#include "code\modules\projectiles\projectile\special_projectiles.dm"