mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-27 15:18:09 +01:00
[MIRROR] Panel port test [IDB IGNORE] (#10447)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Kashargul
parent
2439279209
commit
2f698760c7
@@ -8,7 +8,7 @@
|
||||
throwforce = 0
|
||||
force = 0
|
||||
actions_types = list(/datum/action/item_action/command)
|
||||
w_class = ITEMSIZE_SMALL //CHOMPEdit
|
||||
w_class = ITEMSIZE_SMALL
|
||||
|
||||
var/active = FALSE //Is it set up?
|
||||
var/mob/living/owner //Reference to the owner
|
||||
@@ -18,6 +18,7 @@
|
||||
var/last_activate //Automatically set by things that try to move the bound mob or capture things
|
||||
var/empty_icon = "empty"
|
||||
var/full_icon = "full"
|
||||
var/spawn_mob_name = "A mob"
|
||||
var/capture_chance_modifier = 1 //So we can have special subtypes with different capture rates!
|
||||
|
||||
/obj/item/capture_crystal/Initialize(mapload)
|
||||
@@ -36,11 +37,6 @@
|
||||
if(owner)
|
||||
UnregisterSignal(owner, COMSIG_PARENT_QDELETING)
|
||||
owner = null
|
||||
if(in_gut) // CHOMPedit start
|
||||
UnregisterSignal(in_gut, COMSIG_PARENT_QDELETING)
|
||||
UnregisterSignal(in_gut, COMSIG_BELLY_UPDATE_VORE_FX)
|
||||
UnregisterSignal(in_gut, COMSIG_BELLY_UPDATE_PREY_LOOP)
|
||||
in_gut = null // CHOMPedit end
|
||||
return ..()
|
||||
|
||||
/obj/item/capture_crystal/examine(user)
|
||||
@@ -483,7 +479,7 @@
|
||||
|
||||
//IF the crystal somehow ends up in a tummy and digesting with a bound mob who doesn't want to be eaten, let's move them to the ground
|
||||
/obj/item/capture_crystal/digest_act(var/atom/movable/item_storage = null)
|
||||
if(bound_mob) // CHOMPEdit
|
||||
if(bound_mob)
|
||||
if((bound_mob in contents) && !bound_mob.devourable)
|
||||
bound_mob.forceMove(src.drop_location())
|
||||
return ..()
|
||||
@@ -863,3 +859,102 @@
|
||||
/mob/living
|
||||
var/capture_crystal = TRUE //If TRUE, the mob is capturable. Otherwise it isn't.
|
||||
var/capture_caught = FALSE //If TRUE, the mob has already been caught, and so cannot be caught again.
|
||||
|
||||
/obj/item/capture_crystal/loadout
|
||||
active = TRUE
|
||||
|
||||
/obj/item/capture_crystal/loadout/attack(mob/living/M, mob/living/user)
|
||||
if(!bound_mob && M != user)
|
||||
to_chat(user, span_notice("\The [src] emits an unpleasant tone..."))
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/obj/item/capture_crystal/loadout/attack_self(mob/living/user)
|
||||
if(!bound_mob)
|
||||
to_chat(user, span_notice("\The [src] emits an unpleasant tone... It is not ready yet."))
|
||||
playsound(src, 'sound/effects/capture-crystal-problem.ogg', 75, 1, -1)
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/obj/item/capture_crystal/loadout/capture_chance()
|
||||
return 0
|
||||
|
||||
/obj/item/capture_crystal/cheap
|
||||
name = "cheap capture crystal"
|
||||
desc = "A silent, unassuming crystal in what appears to be some kind of steel housing. This one seems to be cheaply made and can only handle a willing mind."
|
||||
icon = 'icons/obj/capture_crystal_vr.dmi'
|
||||
|
||||
|
||||
//The basic capture command does most of the registration work.
|
||||
/obj/item/capture_crystal/cheap/capture(mob/living/M, mob/living/U)
|
||||
if(!M.capture_crystal || M.capture_caught)
|
||||
to_chat(U, span_warning("This creature is not suitable for capture with this crystal."))
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
return
|
||||
knowyoursignals(M, U)
|
||||
if(isanimal(M) || !M.client)
|
||||
to_chat(U, span_warning("This creature is not suitable for capture."))
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
return
|
||||
owner = U
|
||||
if(!bound_mob)
|
||||
bound_mob = M
|
||||
bound_mob.capture_caught = TRUE
|
||||
persist_storable = FALSE
|
||||
desc = "A silent, unassuming crystal in what appears to be some kind of steel housing. This one seems to be cheaply made and can only handle a willing mind."
|
||||
|
||||
|
||||
/obj/item/capture_crystal/cheap/activate(mob/living/user, target)
|
||||
if(!cooldown_check()) //Are we ready to do things yet?
|
||||
to_chat(thrower, span_notice("\The [src] clicks unsatisfyingly... It is not ready yet."))
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
return
|
||||
if(spawn_mob_type && !bound_mob) //We don't already have a mob, but we know what kind of mob we want
|
||||
bound_mob = new spawn_mob_type(src) //Well let's spawn it then!
|
||||
bound_mob.faction = user.faction
|
||||
spawn_mob_type = null
|
||||
capture(bound_mob, user)
|
||||
if(bound_mob) //We have a mob! Let's finish setting up.
|
||||
user.visible_message("\The [src] clicks, and then emits a small chime.", "\The [src] grows warm in your hand, something inside is awake.")
|
||||
active = TRUE
|
||||
if(!owner) //Do we have an owner? It's pretty unlikely that this would ever happen! But it happens, let's claim the crystal.
|
||||
owner = user
|
||||
if(isanimal(bound_mob))
|
||||
var/mob/living/simple_mob/S = bound_mob
|
||||
S.revivedby = user.name
|
||||
determine_action(user, target)
|
||||
return
|
||||
else if(isliving(target)) //So we don't have a mob, let's try to claim one! Is the target a mob?
|
||||
var/mob/living/M = target
|
||||
last_activate = world.time
|
||||
if(M.capture_caught) //Can't capture things that were already caught.
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
to_chat(user, span_notice("\The [src] clicks unsatisfyingly... \The [M] is already under someone else's control."))
|
||||
return
|
||||
else if(M.stat == DEAD) //Is it dead? We can't influence dead things.
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
to_chat(user, span_notice("\The [src] clicks unsatisfyingly... \The [M] is not in a state to be captured."))
|
||||
return
|
||||
else if(M.client) //Is it player controlled?
|
||||
capture_player(M, user) //We have to do things a little differently if so.
|
||||
return
|
||||
else if(!isanimal(M)) //So it's not player controlled, but it's also not a simplemob?
|
||||
to_chat(user, span_warning("This creature is not suitable for capture."))
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
return
|
||||
var/mob/living/simple_mob/S = M
|
||||
if(!S.ai_holder) //We don't really want to capture simplemobs that don't have an AI
|
||||
to_chat(user, span_warning("This creature is not suitable for capture."))
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
else //Shoot, it didn't work and now it's mad!!!
|
||||
S.ai_holder.go_wake()
|
||||
S.ai_holder.give_target(user, urgent = TRUE)
|
||||
user.visible_message("\The [src] bonks into \the [S], angering it!")
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
to_chat(user, span_notice("\The [src] clicks unsatisfyingly."))
|
||||
update_icon()
|
||||
return
|
||||
//The target is not a mob, so let's not do anything.
|
||||
playsound(src, 'sound/effects/capture-crystal-negative.ogg', 75, 1, -1)
|
||||
to_chat(user, span_notice("\The [src] clicks unsatisfyingly."))
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
show_messages = 0
|
||||
allow_quick_empty = TRUE
|
||||
use_sound = 'sound/items/drop/flesh.ogg'
|
||||
var/egg_name = null //CHOMPAdd
|
||||
var/egg_name = null
|
||||
|
||||
/obj/item/storage/vore_egg/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user