Merge branch 'master' into Ghommie-cit721
This commit is contained in:
@@ -1,95 +0,0 @@
|
||||
/datum/component/archaeology
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
var/list/archdrops = list(/obj/item/bikehorn = list(ARCH_PROB = 100, ARCH_MAXDROP = 1)) // honk~
|
||||
var/prob2drop
|
||||
var/dug
|
||||
var/datum/callback/callback
|
||||
|
||||
/datum/component/archaeology/Initialize(list/_archdrops = list(), datum/callback/_callback)
|
||||
archdrops = _archdrops
|
||||
for(var/i in archdrops)
|
||||
if(isnull(archdrops[i][ARCH_MAXDROP]))
|
||||
archdrops[i][ARCH_MAXDROP] = 1
|
||||
stack_trace("ARCHAEOLOGY WARNING: [parent] contained a null max_drop value in [i].")
|
||||
if(isnull(archdrops[i][ARCH_PROB]))
|
||||
archdrops[i][ARCH_PROB] = 100
|
||||
stack_trace("ARCHAEOLOGY WARNING: [parent] contained a null probability value in [i].")
|
||||
callback = _callback
|
||||
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY,.proc/Dig)
|
||||
RegisterSignal(parent, COMSIG_ATOM_EX_ACT, .proc/BombDig)
|
||||
RegisterSignal(parent, COMSIG_ATOM_SING_PULL, .proc/SingDig)
|
||||
|
||||
/datum/component/archaeology/InheritComponent(datum/component/archaeology/A, i_am_original)
|
||||
var/list/other_archdrops = A.archdrops
|
||||
var/list/_archdrops = archdrops
|
||||
for(var/I in other_archdrops)
|
||||
_archdrops[I] += other_archdrops[I]
|
||||
|
||||
/datum/component/archaeology/proc/Dig(datum/source, obj/item/I, mob/living/user)
|
||||
if(dug)
|
||||
to_chat(user, "<span class='notice'>Looks like someone has dug here already.</span>")
|
||||
return
|
||||
|
||||
if(!isturf(user.loc))
|
||||
return
|
||||
|
||||
if(I.tool_behaviour == TOOL_SHOVEL || I.tool_behaviour == TOOL_MINING)
|
||||
to_chat(user, "<span class='notice'>You start digging...</span>")
|
||||
|
||||
if(I.use_tool(parent, user, 40, volume=50))
|
||||
to_chat(user, "<span class='notice'>You dig a hole.</span>")
|
||||
gets_dug()
|
||||
dug = TRUE
|
||||
SSblackbox.record_feedback("tally", "pick_used_mining", 1, I.type)
|
||||
return COMPONENT_NO_AFTERATTACK
|
||||
|
||||
/datum/component/archaeology/proc/gets_dug()
|
||||
if(dug)
|
||||
return
|
||||
else
|
||||
var/turf/open/OT = get_turf(parent)
|
||||
for(var/thing in archdrops)
|
||||
var/maxtodrop = archdrops[thing][ARCH_MAXDROP]
|
||||
for(var/i in 1 to maxtodrop)
|
||||
if(prob(archdrops[thing][ARCH_PROB])) // can't win them all!
|
||||
new thing(OT)
|
||||
|
||||
if(isopenturf(OT))
|
||||
if(OT.postdig_icon_change)
|
||||
if(istype(OT, /turf/open/floor/plating/asteroid/) && !OT.postdig_icon)
|
||||
var/turf/open/floor/plating/asteroid/AOT = parent
|
||||
AOT.icon_plating = "[AOT.environment_type]_dug"
|
||||
AOT.icon_state = "[AOT.environment_type]_dug"
|
||||
else
|
||||
if(isplatingturf(OT))
|
||||
var/turf/open/floor/plating/POT = parent
|
||||
POT.icon_plating = "[POT.postdig_icon]"
|
||||
POT.icon_state = "[OT.postdig_icon]"
|
||||
|
||||
if(OT.slowdown) //Things like snow slow you down until you dig them.
|
||||
OT.slowdown = 0
|
||||
dug = TRUE
|
||||
if(callback)
|
||||
callback.Invoke()
|
||||
|
||||
/datum/component/archaeology/proc/SingDig(datum/source, S, current_size)
|
||||
switch(current_size)
|
||||
if(STAGE_THREE)
|
||||
if(prob(30))
|
||||
gets_dug()
|
||||
if(STAGE_FOUR)
|
||||
if(prob(50))
|
||||
gets_dug()
|
||||
else
|
||||
if(current_size >= STAGE_FIVE && prob(70))
|
||||
gets_dug()
|
||||
|
||||
/datum/component/archaeology/proc/BombDig(datum/source, severity, target)
|
||||
switch(severity)
|
||||
if(3)
|
||||
return
|
||||
if(2)
|
||||
if(prob(20))
|
||||
gets_dug()
|
||||
if(1)
|
||||
gets_dug()
|
||||
@@ -260,6 +260,15 @@
|
||||
subcategory = CAT_TOOL
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/electrochromatic_kit
|
||||
name = "Electrochromatic Kit"
|
||||
result = /obj/item/electronics/electrochromatic_kit
|
||||
reqs = list(/obj/item/stack/sheet/metal = 1,
|
||||
/obj/item/stack/cable_coil = 1)
|
||||
time = 5
|
||||
subcategory = CAT_TOOL
|
||||
category = CAT_MISC
|
||||
|
||||
////////////
|
||||
//Vehicles//
|
||||
////////////
|
||||
@@ -404,15 +413,6 @@
|
||||
subcategory = CAT_MISCELLANEOUS
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/paperwork
|
||||
name = "Filed Paper Work"
|
||||
result = /obj/item/folder/paperwork_correct
|
||||
time = 10 //Takes time for people to file and complete paper work!
|
||||
tools = list(/obj/item/pen)
|
||||
reqs = list(/obj/item/folder/paperwork = 1)
|
||||
subcategory = CAT_MISCELLANEOUS
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/coconut_bong
|
||||
name = "Coconut Bong"
|
||||
result = /obj/item/bong/coconut
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
/datum/component/knockback
|
||||
/// distance the atom will be thrown
|
||||
var/throw_distance
|
||||
/// whether this can throw anchored targets (tables, etc)
|
||||
var/throw_anchored
|
||||
/// whether this is a gentle throw (default false means people thrown into walls are stunned / take damage)
|
||||
var/throw_gentle
|
||||
|
||||
/datum/component/knockback/Initialize(throw_distance=1)
|
||||
/datum/component/knockback/Initialize(throw_distance=1, throw_gentle=FALSE)
|
||||
if(!isitem(parent) && !ishostile(parent) && !isgun(parent) && !ismachinery(parent) && !isstructure(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
src.throw_distance = throw_distance
|
||||
src.throw_anchored = throw_anchored
|
||||
src.throw_gentle = throw_gentle
|
||||
|
||||
/datum/component/knockback/RegisterWithParent()
|
||||
. = ..()
|
||||
@@ -22,17 +27,29 @@
|
||||
. = ..()
|
||||
UnregisterSignal(parent, list(COMSIG_ITEM_AFTERATTACK, COMSIG_HOSTILE_ATTACKINGTARGET, COMSIG_PROJECTILE_ON_HIT))
|
||||
|
||||
/// triggered after an item attacks something
|
||||
/datum/component/knockback/proc/item_afterattack(obj/item/source, atom/target, mob/user, proximity_flag, click_parameters)
|
||||
if(!proximity_flag)
|
||||
return
|
||||
do_knockback(target, user, get_dir(source, target))
|
||||
|
||||
/// triggered after a hostile simplemob attacks something
|
||||
/datum/component/knockback/proc/hostile_attackingtarget(mob/living/simple_animal/hostile/attacker, atom/target)
|
||||
do_knockback(target, attacker, get_dir(attacker, target))
|
||||
|
||||
/// triggered after a projectile hits something
|
||||
/datum/component/knockback/proc/projectile_hit(atom/fired_from, atom/movable/firer, atom/target, Angle)
|
||||
do_knockback(target, null, angle2dir(Angle))
|
||||
|
||||
|
||||
/**
|
||||
* Throw a target in a direction
|
||||
*
|
||||
* Arguments:
|
||||
* * target - Target atom to throw
|
||||
* * thrower - Thing that caused this atom to be thrown
|
||||
* * throw_dir - Direction to throw the atom
|
||||
*/
|
||||
/datum/component/knockback/proc/do_knockback(atom/target, mob/thrower, throw_dir)
|
||||
if(!ismovable(target) || throw_dir == null)
|
||||
return
|
||||
@@ -43,4 +60,4 @@
|
||||
throw_dir = turn(throw_dir, 180)
|
||||
throw_distance *= -1
|
||||
var/atom/throw_target = get_edge_target_turf(throwee, throw_dir)
|
||||
throwee.safe_throw_at(throw_target, throw_distance, 1, thrower)
|
||||
throwee.safe_throw_at(throw_target, throw_distance, 1, thrower) //, gentle = throw_gentle)
|
||||
|
||||
@@ -39,4 +39,5 @@
|
||||
/obj/effect/abstract/mirage_holder
|
||||
name = "Mirage holder"
|
||||
anchored = TRUE
|
||||
plane = PLANE_SPACE
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
|
||||
Reference in New Issue
Block a user