mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-09 22:25:46 +01:00
Allows us to drop NODROP items if there is other way to get rid of them (#21080)
* adds proc to check if we can drop nodrop items * C:/Program Files/Git/obj/effect/proc_holder/spell/touch refactor, support for wizard spells, xeno spells and changeling shield * bug fixes, cleanup * moved to signals, added support for mime fingergun * fixed bugs * cleanup * same proc for removing weapon from active or any hand * changeling fast swap exist again * cleanup * fix runtime * signals cleanup * review update * Update code/datums/spells/mime.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * Update code/datums/spells/mime.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * Update code/datums/spells/touch_attacks.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * review updates * fixing bug --------- Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
@@ -18,28 +18,40 @@
|
||||
var/weapon_name_simple
|
||||
|
||||
/datum/action/changeling/weapon/try_to_sting(mob/user, mob/target)
|
||||
if(istype(user.l_hand, weapon_type)) //Not the nicest way to do it, but eh
|
||||
qdel(user.l_hand)
|
||||
if(!silent)
|
||||
user.visible_message("<span class='warning'>With a sickening crunch, [user] reforms [user.p_their()] [weapon_name_simple] into an arm!</span>", "<span class='notice'>We assimilate the [weapon_name_simple] back into our body.</span>", "<span class='warning'>You hear organic matter ripping and tearing!</span>")
|
||||
user.update_inv_l_hand()
|
||||
return
|
||||
if(istype(user.r_hand, weapon_type))
|
||||
qdel(user.r_hand)
|
||||
if(!silent)
|
||||
user.visible_message("<span class='warning'>With a sickening crunch, [user] reforms [user.p_their()] [weapon_name_simple] into an arm!</span>", "<span class='notice'>We assimilate the [weapon_name_simple] back into our body.</span>", "<span class='warning'>You hear organic matter ripping and tearing!</span>")
|
||||
user.update_inv_r_hand()
|
||||
if(istype(user.l_hand, weapon_type) || istype(user.r_hand, weapon_type))
|
||||
retract(user, TRUE)
|
||||
return
|
||||
..(user, target)
|
||||
|
||||
/datum/action/changeling/weapon/sting_action(mob/user)
|
||||
SEND_SIGNAL(user, COMSIG_MOB_WEAPON_APPEARS)
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "[user.get_active_hand()] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!")
|
||||
return FALSE
|
||||
var/obj/item/W = new weapon_type(user, silent)
|
||||
var/obj/item/W = new weapon_type(user, silent, src)
|
||||
user.put_in_hands(W)
|
||||
RegisterSignal(user, COMSIG_MOB_WILLINGLY_DROP, PROC_REF(retract), override = TRUE)
|
||||
RegisterSignal(user, COMSIG_MOB_WEAPON_APPEARS, PROC_REF(retract), override = TRUE)
|
||||
return W
|
||||
|
||||
/datum/action/changeling/weapon/proc/retract(atom/target, any_hand = FALSE)
|
||||
SIGNAL_HANDLER
|
||||
if(!ischangeling(owner))
|
||||
return
|
||||
if(!any_hand && !istype(owner.get_active_hand(), weapon_type))
|
||||
return
|
||||
var/done = FALSE
|
||||
if(istype(owner.l_hand, weapon_type))
|
||||
qdel(owner.l_hand)
|
||||
owner.update_inv_l_hand()
|
||||
done = TRUE
|
||||
if(istype(owner.r_hand, weapon_type))
|
||||
qdel(owner.r_hand)
|
||||
owner.update_inv_r_hand()
|
||||
done = TRUE
|
||||
if(done && !silent)
|
||||
owner.visible_message("<span class='warning'>With a sickening crunch, [owner] reforms [owner.p_their()] [weapon_name_simple] into an arm!</span>", "<span class='notice'>We assimilate the [weapon_name_simple] back into our body.</span>", "<span class='warning'>You hear organic matter ripping and tearing!</span>")
|
||||
|
||||
//Parent to space suits and armor.
|
||||
/datum/action/changeling/suit
|
||||
name = "Organic Suit"
|
||||
@@ -122,11 +134,20 @@
|
||||
throwforce = 0 //Just to be on the safe side
|
||||
throw_range = 0
|
||||
throw_speed = 0
|
||||
var/datum/action/changeling/weapon/parent_action
|
||||
|
||||
/obj/item/melee/arm_blade/Initialize(mapload)
|
||||
/obj/item/melee/arm_blade/Initialize(mapload, silent, new_parent_action)
|
||||
. = ..()
|
||||
parent_action = new_parent_action
|
||||
ADD_TRAIT(src, TRAIT_FORCES_OPEN_DOORS_ITEM, ROUNDSTART_TRAIT)
|
||||
|
||||
/obj/item/melee/arm_blade/Destroy()
|
||||
if(parent_action)
|
||||
parent_action.UnregisterSignal(parent_action.owner, COMSIG_MOB_WILLINGLY_DROP)
|
||||
parent_action.UnregisterSignal(parent_action.owner, COMSIG_MOB_WEAPON_APPEARS)
|
||||
parent_action = null
|
||||
return ..()
|
||||
|
||||
/obj/item/melee/arm_blade/afterattack(atom/target, mob/user, proximity)
|
||||
if(!proximity)
|
||||
return
|
||||
@@ -139,7 +160,6 @@
|
||||
var/obj/machinery/computer/C = target
|
||||
C.attack_alien(user) //muh copypasta
|
||||
|
||||
|
||||
/***************************************\
|
||||
|***********COMBAT TENTACLES*************|
|
||||
\***************************************/
|
||||
@@ -177,15 +197,24 @@
|
||||
throwforce = 0 //Just to be on the safe side
|
||||
throw_range = 0
|
||||
throw_speed = 0
|
||||
var/datum/action/changeling/weapon/parent_action
|
||||
|
||||
/obj/item/gun/magic/tentacle/Initialize(mapload, silent)
|
||||
/obj/item/gun/magic/tentacle/Initialize(mapload, silent, new_parent_action)
|
||||
. = ..()
|
||||
parent_action = new_parent_action
|
||||
if(ismob(loc))
|
||||
if(!silent)
|
||||
loc.visible_message("<span class='warning'>[loc.name]\'s arm starts stretching inhumanly!</span>", "<span class='warning'>Our arm twists and mutates, transforming it into a tentacle.</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>")
|
||||
else
|
||||
to_chat(loc, "<span class='notice'>You prepare to extend a tentacle.</span>")
|
||||
|
||||
/obj/item/gun/magic/tentacle/Destroy()
|
||||
if(parent_action)
|
||||
parent_action.UnregisterSignal(parent_action.owner, COMSIG_MOB_WILLINGLY_DROP)
|
||||
parent_action.UnregisterSignal(parent_action.owner, COMSIG_MOB_WEAPON_APPEARS)
|
||||
parent_action = null
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/magic/tentacle/shoot_with_empty_chamber(mob/living/user as mob|obj)
|
||||
to_chat(user, "<span class='warning'>[src] is not ready yet.</span>")
|
||||
|
||||
@@ -382,7 +411,6 @@
|
||||
remaining_uses--
|
||||
return ..()
|
||||
|
||||
|
||||
/***************************************\
|
||||
|*********SPACE SUIT + HELMET***********|
|
||||
\***************************************/
|
||||
|
||||
@@ -13,9 +13,23 @@
|
||||
user.drop_r_hand()
|
||||
else
|
||||
to_chat(user, "<span class='notice'>Large blades of blood spring from your fingers!</span>")
|
||||
var/obj/item/twohanded/required/vamp_claws/claws = new /obj/item/twohanded/required/vamp_claws(user.loc)
|
||||
var/obj/item/twohanded/required/vamp_claws/claws = new /obj/item/twohanded/required/vamp_claws(user.loc, src)
|
||||
RegisterSignal(user, COMSIG_MOB_WILLINGLY_DROP, PROC_REF(dispel))
|
||||
user.put_in_hands(claws)
|
||||
|
||||
/obj/effect/proc_holder/spell/vampire/self/vamp_claws/proc/dispel()
|
||||
SIGNAL_HANDLER
|
||||
var/mob/living/carbon/human/user = action.owner
|
||||
if(user.mind.has_antag_datum(/datum/antagonist/vampire))
|
||||
return
|
||||
var/current
|
||||
if(istype(user.l_hand, /obj/item/twohanded/required/vamp_claws))
|
||||
current = user.l_hand
|
||||
if(istype(user.r_hand, /obj/item/twohanded/required/vamp_claws))
|
||||
current = user.r_hand
|
||||
if(current)
|
||||
qdel(current)
|
||||
to_chat(user, "<span class='notice'>You dispel your claws!</span>")
|
||||
|
||||
/obj/effect/proc_holder/spell/vampire/self/vamp_claws/can_cast(mob/user, charge_check, show_message)
|
||||
var/mob/living/L = user
|
||||
@@ -40,6 +54,17 @@
|
||||
var/durability = 15
|
||||
var/blood_drain_amount = 15
|
||||
var/blood_absorbed_amount = 5
|
||||
var/obj/effect/proc_holder/spell/vampire/self/vamp_claws/parent_spell
|
||||
|
||||
/obj/item/twohanded/required/vamp_claws/Initialize(mapload, new_parent_spell)
|
||||
. = ..()
|
||||
parent_spell = new_parent_spell
|
||||
|
||||
/obj/item/twohanded/required/vamp_claws/Destroy()
|
||||
if(parent_spell)
|
||||
parent_spell.UnregisterSignal(parent_spell.action.owner, COMSIG_MOB_WILLINGLY_DROP)
|
||||
parent_spell = null
|
||||
return ..()
|
||||
|
||||
/obj/item/twohanded/required/vamp_claws/afterattack(atom/target, mob/user, proximity)
|
||||
if(!proximity)
|
||||
@@ -72,8 +97,8 @@
|
||||
user.changeNext_move(CLICK_CD_MELEE * 0.5)
|
||||
|
||||
/obj/item/twohanded/required/vamp_claws/attack_self(mob/user)
|
||||
to_chat(user, "<span class='notice'>You dispel your claws!</span>")
|
||||
qdel(src)
|
||||
to_chat(user, "<span class='notice'>You dispel your claws!</span>")
|
||||
|
||||
/obj/effect/proc_holder/spell/vampire/blood_tendrils
|
||||
name = "Blood Tendrils (10)"
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
return unEquip(r_hand, force) //Why was this not calling unEquip in the first place jesus fuck.
|
||||
|
||||
//Drops the item in our active hand.
|
||||
/mob/proc/drop_item() //THIS. DOES. NOT. NEED. AN. ARGUMENT.
|
||||
/mob/proc/drop_item()
|
||||
if(hand)
|
||||
return drop_l_hand()
|
||||
else
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//unequip
|
||||
/mob/living/carbon/alien/humanoid/unEquip(obj/item/I, force, silent = FALSE)
|
||||
. = ..(I, force)
|
||||
. = ..()
|
||||
if(!. || !I)
|
||||
return
|
||||
|
||||
|
||||
@@ -108,13 +108,22 @@
|
||||
trigger_guard = TRIGGER_GUARD_ALLOW_ALL
|
||||
clumsy_check = FALSE //Stole your uplink! Honk!
|
||||
needs_permit = FALSE //go away beepsky
|
||||
var/obj/effect/proc_holder/spell/mime/fingergun/parent_spell
|
||||
|
||||
/obj/item/gun/projectile/revolver/fingergun/Destroy()
|
||||
if(parent_spell)
|
||||
parent_spell.current_gun = null
|
||||
parent_spell.UnregisterSignal(parent_spell.action.owner, COMSIG_MOB_WILLINGLY_DROP)
|
||||
parent_spell = null
|
||||
return ..()
|
||||
|
||||
/obj/item/gun/projectile/revolver/fingergun/fake
|
||||
desc = "Pew pew pew!"
|
||||
mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rev38/invisible/fake
|
||||
|
||||
/obj/item/gun/projectile/revolver/fingergun/Initialize(mapload)
|
||||
/obj/item/gun/projectile/revolver/fingergun/Initialize(mapload, new_parent_spell)
|
||||
. = ..()
|
||||
parent_spell = new_parent_spell
|
||||
verbs -= /obj/item/gun/projectile/revolver/verb/spin
|
||||
|
||||
/obj/item/gun/projectile/revolver/fingergun/shoot_with_empty_chamber(/*mob/living/user as mob|obj*/)
|
||||
|
||||
Reference in New Issue
Block a user