Merge branch 'master' into upstream-merge-29741
This commit is contained in:
+17
-13
@@ -485,7 +485,7 @@
|
||||
|
||||
/datum/action/spell_action/New(Target)
|
||||
..()
|
||||
var/obj/effect/proc_holder/spell/S = target
|
||||
var/obj/effect/proc_holder/S = target
|
||||
S.action = src
|
||||
name = S.name
|
||||
desc = S.desc
|
||||
@@ -495,36 +495,40 @@
|
||||
button.name = name
|
||||
|
||||
/datum/action/spell_action/Destroy()
|
||||
var/obj/effect/proc_holder/spell/S = target
|
||||
var/obj/effect/proc_holder/S = target
|
||||
S.action = null
|
||||
return ..()
|
||||
|
||||
/datum/action/spell_action/Trigger()
|
||||
if(!..())
|
||||
return 0
|
||||
return FALSE
|
||||
if(target)
|
||||
var/obj/effect/proc_holder/spell = target
|
||||
spell.Click()
|
||||
return 1
|
||||
var/obj/effect/proc_holder/S = target
|
||||
S.Click()
|
||||
return TRUE
|
||||
|
||||
/datum/action/spell_action/IsAvailable()
|
||||
if(!target)
|
||||
return 0
|
||||
var/obj/effect/proc_holder/spell/spell = target
|
||||
if(owner)
|
||||
return spell.can_cast(owner)
|
||||
return 0
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/action/spell_action/spell/IsAvailable()
|
||||
if(!target)
|
||||
return FALSE
|
||||
var/obj/effect/proc_holder/spell/S = target
|
||||
if(owner)
|
||||
return S.can_cast(owner)
|
||||
return FALSE
|
||||
|
||||
/datum/action/spell_action/alien
|
||||
|
||||
/datum/action/spell_action/alien/IsAvailable()
|
||||
if(!target)
|
||||
return 0
|
||||
return FALSE
|
||||
var/obj/effect/proc_holder/alien/ab = target
|
||||
if(owner)
|
||||
return ab.cost_check(ab.check_turf,owner,1)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/datum/antagonist/abductor
|
||||
name = "Abductor"
|
||||
var/datum/objective_team/abductor_team/team
|
||||
var/sub_role
|
||||
var/outfit
|
||||
var/landmark_type
|
||||
var/greet_text
|
||||
|
||||
/datum/antagonist/abductor/agent
|
||||
sub_role = "Agent"
|
||||
outfit = /datum/outfit/abductor/agent
|
||||
landmark_type = /obj/effect/landmark/abductor/agent
|
||||
greet_text = "Use your stealth technology and equipment to incapacitate humans for your scientist to retrieve."
|
||||
|
||||
/datum/antagonist/abductor/scientist
|
||||
sub_role = "Scientist"
|
||||
outfit = /datum/outfit/abductor/scientist
|
||||
landmark_type = /obj/effect/landmark/abductor/scientist
|
||||
greet_text = "Use your stealth technology and equipment to incapacitate humans for your scientist to retrieve."
|
||||
|
||||
/datum/antagonist/abductor/New(datum/mind/new_owner, datum/objective_team/abductor_team/T)
|
||||
team = T
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/abductor/on_gain()
|
||||
SSticker.mode.abductors += owner
|
||||
owner.special_role = "[name] [sub_role]"
|
||||
owner.objectives += team.objectives
|
||||
finalize_abductor()
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/abductor/on_removal()
|
||||
SSticker.mode.abductors -= owner
|
||||
team.members -= owner
|
||||
owner.objectives -= team.objectives
|
||||
if(owner.current)
|
||||
to_chat(owner.current,"<span class='userdanger'>You are no longer the [owner.special_role]!</span>")
|
||||
owner.special_role = null
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/abductor/greet()
|
||||
to_chat(owner.current, "<span class='notice'>You are the [owner.special_role]!</span>")
|
||||
to_chat(owner.current, "<span class='notice'>With the help of your teammate, kidnap and experiment on station crew members!</span>")
|
||||
to_chat(owner.current, "<span class='notice'>[greet_text]</span>")
|
||||
owner.announce_objectives()
|
||||
|
||||
/datum/antagonist/abductor/proc/finalize_abductor()
|
||||
//Equip
|
||||
var/mob/living/carbon/human/H = owner.current
|
||||
H.set_species(/datum/species/abductor)
|
||||
H.real_name = "[team.name] [sub_role]"
|
||||
H.equipOutfit(outfit)
|
||||
|
||||
//Teleport to ship
|
||||
for(var/obj/effect/landmark/abductor/LM in GLOB.landmarks_list)
|
||||
if(istype(LM, landmark_type) && LM.team_number == team.team_number)
|
||||
H.forceMove(LM.loc)
|
||||
break
|
||||
|
||||
SSticker.mode.update_abductor_icons_added(owner)
|
||||
@@ -1,6 +1,5 @@
|
||||
/datum/antagonist/ninja
|
||||
name = "Ninja"
|
||||
var/team
|
||||
var/helping_station = 0
|
||||
var/give_objectives = TRUE
|
||||
|
||||
@@ -19,36 +18,8 @@
|
||||
..(new_owner)
|
||||
helping_station = rand(0,1)
|
||||
|
||||
/datum/antagonist/ninja/proc/equip_space_ninja(mob/living/carbon/human/H = owner.current, safety=0)//Safety in case you need to unequip stuff for existing characters.
|
||||
if(safety)
|
||||
qdel(H.w_uniform)
|
||||
qdel(H.wear_suit)
|
||||
qdel(H.wear_mask)
|
||||
qdel(H.head)
|
||||
qdel(H.shoes)
|
||||
qdel(H.gloves)
|
||||
|
||||
var/obj/item/clothing/suit/space/space_ninja/theSuit = new(H)
|
||||
var/obj/item/dash/energy_katana/EK = new(H)
|
||||
theSuit.energyKatana = EK
|
||||
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/black(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/space_ninja(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(theSuit, slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/space_ninja(H), slot_gloves)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/space_ninja(H), slot_head)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/space_ninja(H), slot_wear_mask)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/night(H), slot_glasses)
|
||||
H.equip_to_slot_or_del(EK, slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/grenade/plastic/x4(H), slot_l_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/tank/internals/emergency_oxygen(H), slot_s_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/tank/jetpack/carbondioxide(H), slot_back)
|
||||
theSuit.randomize_param()
|
||||
|
||||
var/obj/item/implant/explosive/E = new/obj/item/implant/explosive(H)
|
||||
E.implant(H)
|
||||
return 1
|
||||
/datum/antagonist/ninja/proc/equip_space_ninja(mob/living/carbon/human/H = owner.current)
|
||||
return H.equipOutfit(/datum/outfit/ninja)
|
||||
|
||||
/datum/antagonist/ninja/proc/addMemories()
|
||||
owner.store_memory("I am an elite mercenary assassin of the mighty Spider Clan. A <font color='red'><B>SPACE NINJA</B></font>!")
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
GLOBAL_LIST_EMPTY(cinematics)
|
||||
|
||||
// Use to play cinematics.
|
||||
// Watcher can be world,mob, or a list of mobs
|
||||
// Blocks until sequence is done.
|
||||
/proc/Cinematic(id,watcher,datum/callback/special_callback)
|
||||
var/datum/cinematic/playing
|
||||
for(var/V in subtypesof(/datum/cinematic))
|
||||
var/datum/cinematic/C = V
|
||||
if(initial(C.id) == id)
|
||||
playing = new V()
|
||||
break
|
||||
if(!playing)
|
||||
CRASH("Cinematic type not found")
|
||||
if(special_callback)
|
||||
playing.special_callback = special_callback
|
||||
if(watcher == world)
|
||||
playing.is_global = TRUE
|
||||
watcher = GLOB.mob_list
|
||||
playing.play(watcher)
|
||||
|
||||
/obj/screen/cinematic
|
||||
icon = 'icons/effects/station_explosion.dmi'
|
||||
icon_state = "station_intact"
|
||||
layer = 21
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
screen_loc = "1,1"
|
||||
|
||||
/datum/cinematic
|
||||
var/id = CINEMATIC_DEFAULT
|
||||
var/list/watching = list() //List of clients watching this
|
||||
var/list/locked = list() //Who had notransform set during the cinematic
|
||||
var/is_global = FALSE //Global cinematics will override mob-specific ones
|
||||
var/obj/screen/cinematic/screen
|
||||
var/datum/callback/special_callback //For special effects synced with animation (explosions after the countdown etc)
|
||||
var/cleanup_time = 300 //How long for the final screen to remain
|
||||
|
||||
/datum/cinematic/New()
|
||||
GLOB.cinematics += src
|
||||
screen = new(src)
|
||||
|
||||
/datum/cinematic/Destroy()
|
||||
GLOB.cinematics -= src
|
||||
QDEL_NULL(screen)
|
||||
for(var/mob/M in locked)
|
||||
M.notransform = FALSE
|
||||
return ..()
|
||||
|
||||
/datum/cinematic/proc/play(watchers)
|
||||
//Check if you can actually play it (stop mob cinematics for global ones) and create screen objects
|
||||
for(var/A in GLOB.cinematics)
|
||||
var/datum/cinematic/C = A
|
||||
if(C == src)
|
||||
continue
|
||||
if(C.is_global || !is_global)
|
||||
return //Can't play two global or local cinematics at the same time
|
||||
|
||||
//Close all open windows if global
|
||||
if(is_global)
|
||||
for (var/datum/html_interface/hi in GLOB.html_interfaces)
|
||||
hi.closeAll()
|
||||
SStgui.close_all_uis()
|
||||
|
||||
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
if(M in watchers)
|
||||
M.notransform = TRUE //Should this be done for non-global cinematics or even at all ?
|
||||
locked += M
|
||||
//Close watcher ui's
|
||||
SStgui.close_user_uis(M)
|
||||
if(M.client)
|
||||
watching += M.client
|
||||
M.client.screen += screen
|
||||
else
|
||||
if(is_global)
|
||||
M.notransform = TRUE
|
||||
locked += M
|
||||
|
||||
//Actually play it
|
||||
content()
|
||||
//Cleanup
|
||||
sleep(cleanup_time)
|
||||
qdel(src)
|
||||
|
||||
//Sound helper
|
||||
/datum/cinematic/proc/cinematic_sound(s)
|
||||
if(is_global)
|
||||
SEND_SOUND(world,s)
|
||||
else
|
||||
for(var/C in watching)
|
||||
SEND_SOUND(C,s)
|
||||
|
||||
//Fire up special callback for actual effects synchronized with animation (eg real nuke explosion happens midway)
|
||||
/datum/cinematic/proc/special()
|
||||
if(special_callback)
|
||||
special_callback.Invoke()
|
||||
|
||||
//Actual cinematic goes in here
|
||||
/datum/cinematic/proc/content()
|
||||
sleep(50)
|
||||
|
||||
/datum/cinematic/nuke_win
|
||||
id = CINEMATIC_NUKE_WIN
|
||||
|
||||
/datum/cinematic/nuke_win/content()
|
||||
flick("intro_nuke",screen)
|
||||
sleep(35)
|
||||
flick("station_explode_fade_red",screen)
|
||||
cinematic_sound(sound('sound/effects/explosion_distant.ogg'))
|
||||
special()
|
||||
screen.icon_state = "summary_nukewin"
|
||||
|
||||
/datum/cinematic/nuke_miss
|
||||
id = CINEMATIC_NUKE_MISS
|
||||
|
||||
/datum/cinematic/nuke_miss/content()
|
||||
flick("intro_nuke",screen)
|
||||
sleep(35)
|
||||
cinematic_sound(sound('sound/effects/explosion_distant.ogg'))
|
||||
special()
|
||||
flick("station_intact_fade_red",screen)
|
||||
screen.icon_state = "summary_nukefail"
|
||||
|
||||
//Also used for blob
|
||||
/datum/cinematic/nuke_selfdestruct
|
||||
id = CINEMATIC_SELFDESTRUCT
|
||||
|
||||
/datum/cinematic/nuke_selfdestruct/content()
|
||||
flick("intro_nuke",screen)
|
||||
sleep(35)
|
||||
flick("station_explode_fade_red", screen)
|
||||
cinematic_sound(sound('sound/effects/explosion_distant.ogg'))
|
||||
special()
|
||||
screen.icon_state = "summary_selfdes"
|
||||
|
||||
/datum/cinematic/nuke_selfdestruct_miss
|
||||
id = CINEMATIC_SELFDESTRUCT_MISS
|
||||
|
||||
/datum/cinematic/nuke_selfdestruct_miss/content()
|
||||
flick("intro_nuke",screen)
|
||||
sleep(35)
|
||||
cinematic_sound(sound('sound/effects/explosion_distant.ogg'))
|
||||
special()
|
||||
screen.icon_state = "station_intact"
|
||||
|
||||
/datum/cinematic/malf
|
||||
id = CINEMATIC_MALF
|
||||
|
||||
/datum/cinematic/malf/content()
|
||||
flick("intro_malf",screen)
|
||||
sleep(76)
|
||||
flick("station_explode_fade_red",screen)
|
||||
cinematic_sound(sound('sound/effects/explosion_distant.ogg'))
|
||||
special()
|
||||
screen.icon_state = "summary_malf"
|
||||
|
||||
/datum/cinematic/cult
|
||||
id = CINEMATIC_CULT
|
||||
|
||||
/datum/cinematic/cult/content()
|
||||
screen.icon_state = null
|
||||
flick("intro_cult",screen)
|
||||
sleep(25)
|
||||
cinematic_sound(sound('sound/magic/enter_blood.ogg'))
|
||||
sleep(28)
|
||||
cinematic_sound(sound('sound/machines/terminal_off.ogg'))
|
||||
sleep(20)
|
||||
flick("station_corrupted",screen)
|
||||
cinematic_sound(sound('sound/effects/ghost.ogg'))
|
||||
sleep(70)
|
||||
special()
|
||||
|
||||
/datum/cinematic/nuke_annihilation
|
||||
id = CINEMATIC_ANNIHILATION
|
||||
|
||||
/datum/cinematic/nuke_annihilation/content()
|
||||
flick("intro_nuke",screen)
|
||||
sleep(35)
|
||||
flick("station_explode_fade_red",screen)
|
||||
cinematic_sound(sound('sound/effects/explosion_distant.ogg'))
|
||||
special()
|
||||
screen.icon_state = "summary_totala"
|
||||
|
||||
/datum/cinematic/fake
|
||||
id = CINEMATIC_NUKE_FAKE
|
||||
cleanup_time = 100
|
||||
|
||||
/datum/cinematic/fake/content()
|
||||
flick("intro_nuke",screen)
|
||||
sleep(35)
|
||||
cinematic_sound(sound('sound/items/bikehorn.ogg'))
|
||||
flick("summary_selfdes",screen) //???
|
||||
special()
|
||||
|
||||
/datum/cinematic/no_core
|
||||
id = CINEMATIC_NUKE_NO_CORE
|
||||
cleanup_time = 100
|
||||
|
||||
/datum/cinematic/no_core/content()
|
||||
flick("intro_nuke",screen)
|
||||
sleep(35)
|
||||
flick("station_intact",screen)
|
||||
cinematic_sound(sound('sound/ambience/signal.ogg'))
|
||||
sleep(100)
|
||||
|
||||
/datum/cinematic/nuke_far
|
||||
id = CINEMATIC_NUKE_FAR
|
||||
cleanup_time = 0
|
||||
|
||||
/datum/cinematic/nuke_far/content()
|
||||
cinematic_sound(sound('sound/effects/explosion_distant.ogg'))
|
||||
special()
|
||||
|
||||
/* Intended usage.
|
||||
Nuke.Explosion()
|
||||
-> Cinematic(NUKE_BOOM,world)
|
||||
-> ActualExplosion()
|
||||
-> Mode.OnExplosion()
|
||||
|
||||
|
||||
Narsie()
|
||||
-> Cinematic(CULT,world)
|
||||
*/
|
||||
@@ -94,7 +94,8 @@ Stands have a lot of procs which mimic mob procs. Rather than inserting hooks fo
|
||||
* Allows the component to react to ownership transfers
|
||||
1. `/datum/component/proc/_RemoveNoSignal()` (private, final)
|
||||
* Internal, clears the parent var and removes the component from the parents component list
|
||||
1. `/datum/component/proc/RegisterSignal(signal(string), proc_ref(type), override(boolean))` (protected, final) (Consider removing for performance gainz)
|
||||
1. `/datum/component/proc/RegisterSignal(signal(string/list of strings), proc_ref(type), override(boolean))` (protected, final) (Consider removing for performance gainz)
|
||||
* If signal is a list it will be as if RegisterSignal was called for each of the entries with the same following arguments
|
||||
* Makes a component listen for the specified `signal` on it's `parent` datum.
|
||||
* When that signal is recieved `proc_ref` will be called on the component, along with associated arguments
|
||||
* Example proc ref: `.proc/OnEvent`
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
P.datum_components = null
|
||||
parent = null
|
||||
|
||||
/datum/component/proc/RegisterSignal(sig_type, proc_on_self, override = FALSE)
|
||||
/datum/component/proc/RegisterSignal(sig_type_or_types, proc_on_self, override = FALSE)
|
||||
if(QDELETED(src))
|
||||
return
|
||||
var/list/procs = signal_procs
|
||||
@@ -103,12 +103,14 @@
|
||||
procs = list()
|
||||
signal_procs = procs
|
||||
|
||||
if(!override)
|
||||
. = procs[sig_type]
|
||||
if(.)
|
||||
stack_trace("[sig_type] overridden. Use override = TRUE to suppress this warning")
|
||||
|
||||
procs[sig_type] = CALLBACK(src, proc_on_self)
|
||||
var/list/sig_types = islist(sig_type_or_types) ? sig_type_or_types : list(sig_type_or_types)
|
||||
for(var/sig_type in sig_types)
|
||||
if(!override)
|
||||
. = procs[sig_type]
|
||||
if(.)
|
||||
stack_trace("[sig_type] overridden. Use override = TRUE to suppress this warning")
|
||||
|
||||
procs[sig_type] = CALLBACK(src, proc_on_self)
|
||||
|
||||
/datum/component/proc/InheritComponent(datum/component/C, i_am_original)
|
||||
return
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
/datum/component/slippery/Initialize(_intensity, _lube_flags = NONE)
|
||||
intensity = max(_intensity, 0)
|
||||
lube_flags = _lube_flags
|
||||
if(ismovableatom(parent))
|
||||
RegisterSignal(COMSIG_MOVABLE_CROSSED, .proc/Slip)
|
||||
else
|
||||
RegisterSignal(COMSIG_ATOM_ENTERED, .proc/Slip)
|
||||
RegisterSignal(list(COMSIG_MOVABLE_CROSSED, COMSIG_ATOM_ENTERED), .proc/Slip)
|
||||
|
||||
/datum/component/slippery/proc/Slip(atom/movable/AM)
|
||||
var/mob/victim = AM
|
||||
|
||||
@@ -24,22 +24,9 @@
|
||||
if(use_delay_override)
|
||||
use_delay = use_delay_override
|
||||
|
||||
if(istype(parent, /atom))
|
||||
RegisterSignal(COMSIG_ATOM_BLOB_ACT, .proc/play_squeak)
|
||||
RegisterSignal(COMSIG_ATOM_HULK_ATTACK, .proc/play_squeak)
|
||||
RegisterSignal(COMSIG_PARENT_ATTACKBY, .proc/play_squeak)
|
||||
if(istype(parent, /atom/movable))
|
||||
RegisterSignal(COMSIG_MOVABLE_CROSSED, .proc/play_squeak)
|
||||
RegisterSignal(COMSIG_MOVABLE_COLLIDE, .proc/play_squeak)
|
||||
RegisterSignal(COMSIG_MOVABLE_IMPACT, .proc/play_squeak)
|
||||
if(istype(parent, /obj/item))
|
||||
RegisterSignal(COMSIG_ITEM_ATTACK, .proc/play_squeak)
|
||||
RegisterSignal(COMSIG_ITEM_ATTACK_SELF, .proc/use_squeak)
|
||||
RegisterSignal(COMSIG_ITEM_ATTACK_OBJ, .proc/play_squeak)
|
||||
if(istype(parent, /obj/item/clothing/shoes))
|
||||
RegisterSignal(COMSIG_SHOES_STEP_ACTION, .proc/step_squeak)
|
||||
else
|
||||
RegisterSignal(COMSIG_ATOM_ENTERED, .proc/play_squeak)
|
||||
RegisterSignal(list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_BLOB_ACT, COMSIG_ATOM_HULK_ATTACK, COMSIG_PARENT_ATTACKBY, COMSIG_MOVABLE_CROSSED, COMSIG_MOVABLE_COLLIDE, COMSIG_MOVABLE_IMPACT, COMSIG_ITEM_ATTACK, COMSIG_ITEM_ATTACK_OBJ, COMSIG_ITEM_ATTACK_OBJ), .proc/play_squeak)
|
||||
RegisterSignal(COMSIG_ITEM_ATTACK_SELF, .proc/use_squeak)
|
||||
RegisterSignal(COMSIG_SHOES_STEP_ACTION, .proc/step_squeak)
|
||||
|
||||
/datum/component/squeak/proc/play_squeak()
|
||||
if(prob(squeak_chance))
|
||||
|
||||
@@ -1,103 +1,111 @@
|
||||
#define FORWARD -1
|
||||
#define BACKWARD 1
|
||||
|
||||
/datum/construction
|
||||
var/list/steps
|
||||
var/atom/holder
|
||||
var/result
|
||||
var/list/steps_desc
|
||||
|
||||
/datum/construction/New(atom)
|
||||
..()
|
||||
holder = atom
|
||||
if(!holder) //don't want this without a holder
|
||||
qdel(src)
|
||||
set_desc(steps.len)
|
||||
return
|
||||
|
||||
/datum/construction/proc/next_step()
|
||||
steps.len--
|
||||
if(!steps.len)
|
||||
spawn_result()
|
||||
else
|
||||
set_desc(steps.len)
|
||||
return
|
||||
|
||||
/datum/construction/proc/action(atom/used_atom,mob/user)
|
||||
return
|
||||
|
||||
/datum/construction/proc/check_step(atom/used_atom,mob/user) //check last step only
|
||||
var/valid_step = is_right_key(used_atom)
|
||||
if(valid_step)
|
||||
if(custom_action(valid_step, used_atom, user))
|
||||
next_step()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/construction/proc/is_right_key(atom/used_atom) // returns current step num if used_atom is of the right type.
|
||||
var/list/L = steps[steps.len]
|
||||
if(istype(used_atom, L["key"]))
|
||||
return steps.len
|
||||
return 0
|
||||
|
||||
/datum/construction/proc/custom_action(step, used_atom, user)
|
||||
return 1
|
||||
|
||||
/datum/construction/proc/check_all_steps(atom/used_atom,mob/user) //check all steps, remove matching one.
|
||||
for(var/i=1;i<=steps.len;i++)
|
||||
var/list/L = steps[i];
|
||||
if(istype(used_atom, L["key"]))
|
||||
if(custom_action(i, used_atom, user))
|
||||
steps[i]=null;//stupid byond list from list removal...
|
||||
listclearnulls(steps);
|
||||
if(!steps.len)
|
||||
spawn_result()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/datum/construction/proc/spawn_result()
|
||||
if(result)
|
||||
new result(get_turf(holder))
|
||||
qdel(holder)
|
||||
return
|
||||
|
||||
/datum/construction/proc/set_desc(index as num)
|
||||
var/list/step = steps[index]
|
||||
holder.desc = step["desc"]
|
||||
return
|
||||
|
||||
/datum/construction/reversible
|
||||
var/index
|
||||
|
||||
/datum/construction/reversible/New(atom)
|
||||
..()
|
||||
index = steps.len
|
||||
return
|
||||
|
||||
/datum/construction/reversible/proc/update_index(diff as num)
|
||||
index+=diff
|
||||
if(index==0)
|
||||
spawn_result()
|
||||
else
|
||||
set_desc(index)
|
||||
return
|
||||
|
||||
/datum/construction/reversible/is_right_key(atom/used_atom) // returns index step
|
||||
var/list/L = steps[index]
|
||||
if(istype(used_atom, L["key"]))
|
||||
return FORWARD //to the first step -> forward
|
||||
else if(L["backkey"] && istype(used_atom, L["backkey"]))
|
||||
return BACKWARD //to the last step -> backwards
|
||||
return 0
|
||||
|
||||
/datum/construction/reversible/check_step(atom/used_atom,mob/user)
|
||||
var/diff = is_right_key(used_atom)
|
||||
if(diff)
|
||||
if(custom_action(index, diff, used_atom, user))
|
||||
update_index(diff)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/construction/reversible/custom_action(index, diff, used_atom, user)
|
||||
return 1
|
||||
#define FORWARD -1
|
||||
#define BACKWARD 1
|
||||
|
||||
/datum/construction
|
||||
var/list/steps
|
||||
var/atom/holder
|
||||
var/result
|
||||
var/list/steps_desc
|
||||
|
||||
/datum/construction/New(atom)
|
||||
..()
|
||||
holder = atom
|
||||
if(!holder) //don't want this without a holder
|
||||
qdel(src)
|
||||
set_desc(steps.len)
|
||||
return
|
||||
|
||||
/datum/construction/proc/next_step()
|
||||
steps.len--
|
||||
if(!steps.len)
|
||||
spawn_result()
|
||||
else
|
||||
set_desc(steps.len)
|
||||
return
|
||||
|
||||
/datum/construction/proc/action(atom/used_atom,mob/user)
|
||||
return
|
||||
|
||||
/datum/construction/proc/check_step(atom/used_atom,mob/user) //check last step only
|
||||
var/valid_step = is_right_key(used_atom)
|
||||
if(valid_step)
|
||||
if(custom_action(valid_step, used_atom, user))
|
||||
next_step()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/construction/proc/is_right_key(atom/used_atom) // returns current step num if used_atom is of the right type.
|
||||
var/list/L = steps[steps.len]
|
||||
if(istype(used_atom, L["key"]))
|
||||
return steps.len
|
||||
return 0
|
||||
|
||||
/datum/construction/proc/custom_action(step, used_atom, user)
|
||||
return 1
|
||||
|
||||
/datum/construction/proc/check_all_steps(atom/used_atom,mob/user) //check all steps, remove matching one.
|
||||
for(var/i=1;i<=steps.len;i++)
|
||||
var/list/L = steps[i];
|
||||
if(istype(used_atom, L["key"]))
|
||||
if(custom_action(i, used_atom, user))
|
||||
steps[i]=null;//stupid byond list from list removal...
|
||||
listclearnulls(steps);
|
||||
if(!steps.len)
|
||||
spawn_result()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/datum/construction/proc/spawn_result()
|
||||
if(result)
|
||||
new result(get_turf(holder))
|
||||
qdel(holder)
|
||||
return
|
||||
|
||||
/datum/construction/proc/spawn_mecha_result()
|
||||
if(result)
|
||||
var/obj/mecha/m = new result(get_turf(holder))
|
||||
var/obj/item/oldcell = locate (/obj/item/stock_parts/cell) in m
|
||||
QDEL_NULL(oldcell)
|
||||
m.CheckParts(holder.contents)
|
||||
QDEL_NULL(holder)
|
||||
|
||||
/datum/construction/proc/set_desc(index as num)
|
||||
var/list/step = steps[index]
|
||||
holder.desc = step["desc"]
|
||||
return
|
||||
|
||||
/datum/construction/reversible
|
||||
var/index
|
||||
|
||||
/datum/construction/reversible/New(atom)
|
||||
..()
|
||||
index = steps.len
|
||||
return
|
||||
|
||||
/datum/construction/reversible/proc/update_index(diff as num)
|
||||
index+=diff
|
||||
if(index==0)
|
||||
spawn_result()
|
||||
else
|
||||
set_desc(index)
|
||||
return
|
||||
|
||||
/datum/construction/reversible/is_right_key(atom/used_atom) // returns index step
|
||||
var/list/L = steps[index]
|
||||
if(istype(used_atom, L["key"]))
|
||||
return FORWARD //to the first step -> forward
|
||||
else if(L["backkey"] && istype(used_atom, L["backkey"]))
|
||||
return BACKWARD //to the last step -> backwards
|
||||
return 0
|
||||
|
||||
/datum/construction/reversible/check_step(atom/used_atom,mob/user)
|
||||
var/diff = is_right_key(used_atom)
|
||||
if(diff)
|
||||
if(custom_action(index, diff, used_atom, user))
|
||||
update_index(diff)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/construction/reversible/custom_action(index, diff, used_atom, user)
|
||||
return 1
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
/datum/action/neck_chop/Trigger()
|
||||
if(owner.incapacitated())
|
||||
to_chat(owner, "<span class='warning'>You can't use Krav Maga while you're incapacitated.</span>")
|
||||
to_chat(owner, "<span class='warning'>You can't use [name] while you're incapacitated.</span>")
|
||||
return
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if (H.mind.martial_art.streak == "neck_chop")
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
/datum/action/leg_sweep/Trigger()
|
||||
if(owner.incapacitated())
|
||||
to_chat(owner, "<span class='warning'>You can't use Krav Maga while you're incapacitated.</span>")
|
||||
to_chat(owner, "<span class='warning'>You can't use [name] while you're incapacitated.</span>")
|
||||
return
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if (H.mind.martial_art.streak == "leg_sweep")
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
/datum/action/lung_punch/Trigger()
|
||||
if(owner.incapacitated())
|
||||
to_chat(owner, "<span class='warning'>You can't use Krav Maga while you're incapacitated.</span>")
|
||||
to_chat(owner, "<span class='warning'>You can't use [name] while you're incapacitated.</span>")
|
||||
return
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if (H.mind.martial_art.streak == "quick_choke")
|
||||
@@ -57,14 +57,14 @@
|
||||
|
||||
/datum/martial_art/krav_maga/teach(mob/living/carbon/human/H,make_temporary=0)
|
||||
if(..())
|
||||
to_chat(H, "<span class = 'userdanger'>You know the arts of Krav Maga!</span>")
|
||||
to_chat(H, "<span class = 'userdanger'>You know the arts of [name]!</span>")
|
||||
to_chat(H, "<span class = 'danger'>Place your cursor over a move at the top of the screen to see what it does.</span>")
|
||||
neckchop.Grant(H)
|
||||
legsweep.Grant(H)
|
||||
lungpunch.Grant(H)
|
||||
|
||||
/datum/martial_art/krav_maga/on_remove(mob/living/carbon/human/H)
|
||||
to_chat(H, "<span class = 'userdanger'>You suddenly forget the arts of Krav Maga...</span>")
|
||||
to_chat(H, "<span class = 'userdanger'>You suddenly forget the arts of [name]...</span>")
|
||||
neckchop.Remove(H)
|
||||
legsweep.Remove(H)
|
||||
lungpunch.Remove(H)
|
||||
@@ -140,7 +140,7 @@
|
||||
playsound(get_turf(D), 'sound/effects/hit_punch.ogg', 50, 1, -1)
|
||||
D.visible_message("<span class='danger'>[A] [picked_hit_type] [D]!</span>", \
|
||||
"<span class='userdanger'>[A] [picked_hit_type] you!</span>")
|
||||
add_logs(A, D, "[picked_hit_type] with Krav Maga")
|
||||
add_logs(A, D, "[picked_hit_type] with [name]")
|
||||
return 1
|
||||
|
||||
/datum/martial_art/krav_maga/disarm_act(var/mob/living/carbon/human/A, var/mob/living/carbon/human/D)
|
||||
|
||||
+1
-55
@@ -590,8 +590,6 @@
|
||||
if(src in SSticker.mode.abductors)
|
||||
text += "<b>Abductor</b> | <a href='?src=\ref[src];abductor=clear'>human</a>"
|
||||
text += " | <a href='?src=\ref[src];common=undress'>undress</a> | <a href='?src=\ref[src];abductor=equip'>equip</a>"
|
||||
else
|
||||
text += "<a href='?src=\ref[src];abductor=abductor'>abductor</a> | <b>human</b>"
|
||||
|
||||
if(current && current.client && (ROLE_ABDUCTOR in current.client.prefs.be_special))
|
||||
text += " | Enabled in Prefs"
|
||||
@@ -1244,13 +1242,6 @@
|
||||
if("clear")
|
||||
to_chat(usr, "Not implemented yet. Sorry!")
|
||||
//SSticker.mode.update_abductor_icons_removed(src)
|
||||
if("abductor")
|
||||
if(!ishuman(current))
|
||||
to_chat(usr, "<span class='warning'>This only works on humans!</span>")
|
||||
return
|
||||
make_Abductor()
|
||||
log_admin("[key_name(usr)] turned [current] into abductor.")
|
||||
SSticker.mode.update_abductor_icons_added(src)
|
||||
if("equip")
|
||||
if(!ishuman(current))
|
||||
to_chat(usr, "<span class='warning'>This only works on humans!</span>")
|
||||
@@ -1496,52 +1487,7 @@
|
||||
take_uplink()
|
||||
var/fail = 0
|
||||
fail |= !SSticker.mode.equip_revolutionary(current)
|
||||
|
||||
/datum/mind/proc/make_Abductor()
|
||||
var/role = alert("Abductor Role ?","Role","Agent","Scientist")
|
||||
var/team = input("Abductor Team ?","Team ?") in list(1,2,3,4)
|
||||
var/teleport = alert("Teleport to ship ?","Teleport","Yes","No")
|
||||
|
||||
if(!role || !team || !teleport)
|
||||
return
|
||||
|
||||
if(!ishuman(current))
|
||||
return
|
||||
|
||||
SSticker.mode.abductors |= src
|
||||
|
||||
var/datum/objective/experiment/O = new
|
||||
O.owner = src
|
||||
objectives += O
|
||||
|
||||
var/mob/living/carbon/human/H = current
|
||||
|
||||
H.set_species(/datum/species/abductor)
|
||||
var/datum/species/abductor/S = H.dna.species
|
||||
|
||||
if(role == "Scientist")
|
||||
S.scientist = TRUE
|
||||
S.team = team
|
||||
|
||||
var/list/obj/effect/landmark/abductor/agent_landmarks = new
|
||||
var/list/obj/effect/landmark/abductor/scientist_landmarks = new
|
||||
agent_landmarks.len = 4
|
||||
scientist_landmarks.len = 4
|
||||
for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list)
|
||||
if(istype(A, /obj/effect/landmark/abductor/agent))
|
||||
agent_landmarks[text2num(A.team)] = A
|
||||
else if(istype(A, /obj/effect/landmark/abductor/scientist))
|
||||
scientist_landmarks[text2num(A.team)] = A
|
||||
|
||||
var/obj/effect/landmark/L
|
||||
if(teleport=="Yes")
|
||||
switch(role)
|
||||
if("Agent")
|
||||
L = agent_landmarks[team]
|
||||
if("Scientist")
|
||||
L = scientist_landmarks[team]
|
||||
H.forceMove(L.loc)
|
||||
|
||||
|
||||
/datum/mind/proc/AddSpell(obj/effect/proc_holder/spell/S)
|
||||
spell_list += S
|
||||
S.action.Grant(current)
|
||||
|
||||
@@ -102,10 +102,10 @@
|
||||
if(implants)
|
||||
for(var/implant_type in implants)
|
||||
var/obj/item/implant/I = new implant_type(H)
|
||||
I.implant(H, null, silent=TRUE)
|
||||
I.implant(H, null, TRUE)
|
||||
|
||||
H.update_body()
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/datum/outfit/proc/apply_fingerprints(mob/living/carbon/human/H)
|
||||
if(!istype(H))
|
||||
|
||||
Reference in New Issue
Block a user