Merge pull request #8674 from uraniummeltdown/attacks

[READY] Attack Code Update
This commit is contained in:
tigercat2000
2018-03-22 11:55:53 -07:00
committed by GitHub
178 changed files with 2457 additions and 1949 deletions
+8
View File
@@ -4,3 +4,11 @@
/obj/effect
icon = 'icons/effects/effects.dmi'
burn_state = LAVA_PROOF | FIRE_PROOF
resistance_flags = INDESTRUCTIBLE
/obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
return
/obj/effect/fire_act()
return
@@ -0,0 +1,23 @@
//temporary visual effects(/obj/effect/temp_visual) used by clockcult stuff
/obj/effect/temp_visual/ratvar
name = "ratvar's light"
icon = 'icons/effects/clockwork_effects.dmi'
duration = 8
randomdir = 0
layer = ABOVE_NORMAL_TURF_LAYER
/obj/effect/temp_visual/ratvar/beam
icon_state = "ratvarbeamglow"
/obj/effect/temp_visual/ratvar/beam/grille
layer = BELOW_OBJ_LAYER
/obj/effect/temp_visual/ratvar/floor
icon_state = "ratvarfloorglow"
/obj/effect/temp_visual/ratvar/grille
icon_state = "ratvargrilleglow"
layer = BELOW_OBJ_LAYER
/obj/effect/temp_visual/ratvar/grille/broken
icon_state = "ratvarbrokengrilleglow"
+7 -7
View File
@@ -80,9 +80,9 @@
if(T.density && T.explosion_block)
cached_exp_block[T] += T.explosion_block
for(var/obj/machinery/door/D in T)
if(D.density && D.explosion_block)
cached_exp_block[T] += D.explosion_block
for(var/obj/O in T)
var/the_block = O.explosion_block
cached_exp_block[T] += the_block == EXPLOSION_BLOCK_PROC ? O.GetExplosionBlock() : the_block
CHECK_TICK
for(var/A in affected_turfs)
@@ -212,12 +212,12 @@
var/turf/TT = T
while(TT != epicenter)
TT = get_step_towards(TT,epicenter)
if(TT.density && TT.explosion_block)
if(TT.density)
dist += TT.explosion_block
for(var/obj/machinery/door/D in TT)
if(D.density && D.explosion_block)
dist += D.explosion_block
for(var/obj/O in T)
var/the_block = O.explosion_block
dist += the_block == EXPLOSION_BLOCK_PROC ? O.GetExplosionBlock() : the_block
if(dist < dev)
T.color = "red"
-1
View File
@@ -44,7 +44,6 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
var/permeability_coefficient = 1 // for chemicals/diseases
var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit)
var/slowdown = 0 // How much clothing is slowing you down. Negative values speeds you up
var/armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
var/armour_penetration = 0 //percentage of armour effectiveness to remove
var/list/allowed = null //suit storage stuff.
var/obj/item/device/uplink/hidden/hidden_uplink = null // All items can have an uplink hidden inside, just remember to add the triggers.
@@ -271,7 +271,6 @@
created_window = /obj/structure/window/plasmabasic
full_window = /obj/structure/window/full/plasmabasic
/obj/item/stack/sheet/plasmaglass/attack_self(mob/user as mob)
construct_window(user)
@@ -359,7 +358,7 @@
origin_tech = "plasmatech=2;materials=2"
created_window = /obj/structure/window/plasmareinforced
full_window = /obj/structure/window/full/plasmareinforced
armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0)
/obj/item/stack/sheet/plasmarglass/attack_self(mob/user as mob)
construct_window(user)
@@ -133,9 +133,9 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list(
new /datum/stack_recipe("Mass Driver frame", /obj/machinery/mass_driver_frame, 3, time = 50, one_per_turf = 1),
null,
new /datum/stack_recipe_list("airlock assemblies", list(
new /datum/stack_recipe("vault door assembly", /obj/structure/door_assembly/door_assembly_vault, 6, time = 50, one_per_turf = 1, on_floor = 1),
new /datum/stack_recipe("high security airlock assembly", /obj/structure/door_assembly/door_assembly_highsecurity, 6, time = 50, one_per_turf = 1, on_floor = 1),
), 4),
new /datum/stack_recipe("vault door assembly", /obj/structure/door_assembly/door_assembly_vault, 8, time = 50, one_per_turf = 1, on_floor = 1),
)),
)
/obj/item/stack/sheet/plasteel
+5 -5
View File
@@ -151,21 +151,21 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "sword0"
item_state = "sword0"
var/active = 0.0
var/active = FALSE
w_class = WEIGHT_CLASS_SMALL
attack_verb = list("attacked", "struck", "hit")
/obj/item/toy/sword/attack_self(mob/user as mob)
active = !(active)
/obj/item/toy/sword/attack_self(mob/user)
active = !active
if(active)
to_chat(user, "<span class='notice'>You extend the plastic blade with a quick flick of your wrist.</span>")
playsound(user, 'sound/weapons/saberon.ogg', 50, 1)
playsound(user, 'sound/weapons/saberon.ogg', 20, 1)
icon_state = "swordblue"
item_state = "swordblue"
w_class = WEIGHT_CLASS_BULKY
else
to_chat(user, "<span class='notice'>You push the plastic blade back down into the handle.</span>")
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
playsound(user, 'sound/weapons/saberoff.ogg', 20, 1)
icon_state = "sword0"
item_state = "sword0"
w_class = WEIGHT_CLASS_SMALL
+6 -2
View File
@@ -22,8 +22,8 @@ LIGHTERS ARE IN LIGHTERS.DM
slot_flags = SLOT_EARS|SLOT_MASK
w_class = WEIGHT_CLASS_TINY
body_parts_covered = null
attack_verb = list("burnt", "singed")
var/lit = 0
attack_verb = null
var/lit = FALSE
var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
var/icon_off = "cigoff"
var/type_butt = /obj/item/weapon/cigbutt
@@ -128,7 +128,11 @@ LIGHTERS ARE IN LIGHTERS.DM
/obj/item/clothing/mask/cigarette/proc/light(flavor_text = null)
if(!src.lit)
src.lit = 1
name = "lit [name]"
attack_verb = list("burnt", "singed")
hitsound = 'sound/items/welder.ogg'
damtype = "fire"
force = 4
if(reagents.get_reagent_amount("plasma")) // the plasma explodes when exposed to fire
var/datum/effect_system/reagents_explosion/e = new()
e.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0)
@@ -50,3 +50,4 @@
icon = 'icons/obj/janitor.dmi'
icon_state = "holosign"
anchored = 1
armor = list(melee = 0, bullet = 50, laser = 50, energy = 50, bomb = 0, bio = 0, rad = 0)
+53 -19
View File
@@ -13,7 +13,7 @@
throwforce = 4
flags = CONDUCT
slot_flags = SLOT_BELT
attack_verb = list("burnt", "singed")
attack_verb = null
var/lit = 0
/obj/item/weapon/lighter/zippo
@@ -38,6 +38,10 @@
w_class = WEIGHT_CLASS_BULKY
icon_state = icon_on
item_state = icon_on
force = 5
damtype = "fire"
hitsound = 'sound/items/welder.ogg'
attack_verb = list("burnt", "singed")
if(istype(src, /obj/item/weapon/lighter/zippo) )
user.visible_message("<span class='rose'>Without even breaking stride, [user] flips open and lights [src] in one smooth movement.</span>")
playsound(src.loc, 'sound/items/ZippoLight.ogg', 25, 1)
@@ -62,6 +66,9 @@
w_class = WEIGHT_CLASS_TINY
icon_state = icon_off
item_state = icon_off
hitsound = "swing_hit"
force = 0
attack_verb = null //human_defense.dm takes care of it
if(istype(src, /obj/item/weapon/lighter/zippo) )
user.visible_message("<span class='rose'>You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing. Wow.")
playsound(src.loc, 'sound/items/ZippoClose.ogg', 25, 1)
@@ -145,47 +152,74 @@
desc = "A simple match stick, used for lighting fine smokables."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "match_unlit"
var/lit = 0
var/lit = FALSE
var/burnt = FALSE
var/smoketime = 5
w_class = WEIGHT_CLASS_TINY
origin_tech = "materials=1"
attack_verb = list("burnt", "singed")
attack_verb = null
/obj/item/weapon/match/process()
var/turf/location = get_turf(src)
smoketime--
if(smoketime < 1)
icon_state = "match_burnt"
lit = -1
processing_objects.Remove(src)
return
matchburnout()
if(location)
location.hotspot_expose(700, 5)
return
/obj/item/weapon/match/dropped(mob/user as mob)
if(lit == 1)
lit = -1
/obj/item/weapon/match/fire_act()
matchignite()
/obj/item/weapon/match/proc/matchignite()
if(!lit && !burnt)
lit = TRUE
icon_state = "match_lit"
damtype = "fire"
force = 3
hitsound = 'sound/items/welder.ogg'
item_state = "cigon"
name = "lit match"
desc = "A match. This one is lit."
attack_verb = list("burnt","singed")
processing_objects.Add(src)
update_icon()
/obj/item/weapon/match/proc/matchburnout()
if(lit)
lit = FALSE
burnt = TRUE
damtype = "brute"
force = initial(force)
icon_state = "match_burnt"
item_state = "cigoff"
name = "burnt match"
desc = "A match. This one has seen better days."
attack_verb = list("flicked")
processing_objects.Remove(src)
return ..()
/obj/item/weapon/match/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
/obj/item/weapon/match/dropped(mob/user)
matchburnout()
. = ..()
/obj/item/weapon/match/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!isliving(M))
return ..()
if(lit == 1) M.IgniteMob()
if(!istype(M, /mob))
return ..()
if(istype(M.wear_mask, /obj/item/clothing/mask/cigarette) && user.zone_sel.selecting == "mouth" && lit == 1)
var/obj/item/clothing/mask/cigarette/cig = M.wear_mask
if(lit && M.IgniteMob())
message_admins("[key_name_admin(user)] set [key_name_admin(M)] on fire")
log_game("[key_name(user)] set [key_name(M)] on fire")
var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M)
if(lit && cig && user.a_intent == INTENT_HELP)
if(cig.lit)
to_chat(user, "<span class='notice'>[cig] is already lit.</span>")
if(M == user)
cig.attackby(src, user)
else
cig.light("<span class='notice'>[user] holds the [name] out for [M], and lights the [cig.name].</span>")
cig.light("<span class='notice'>[user] holds [src] out for [M], and lights [cig].</span>")
else
..()
/obj/item/proc/help_light_cig(mob/living/M)
var/mask_item = M.get_item_by_slot(slot_wear_mask)
if(istype(mask_item, /obj/item/clothing/mask/cigarette))
return mask_item
@@ -12,7 +12,7 @@
light_power = 2
var/brightness_on = 2
var/colormap = list(red=LIGHT_COLOR_RED, blue=LIGHT_COLOR_LIGHTBLUE, green=LIGHT_COLOR_GREEN, purple=LIGHT_COLOR_PURPLE, rainbow=LIGHT_COLOR_WHITE)
/obj/item/weapon/melee/energy/suicide_act(mob/user)
user.visible_message(pick("<span class='suicide'>[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.</span>", \
"<span class='suicide'>[user] is falling on the [src.name]! It looks like \he's trying to commit suicide.</span>"))
@@ -70,7 +70,7 @@
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
w_class_on = WEIGHT_CLASS_HUGE
hitsound = "swing_hit"
hitsound = 'sound/weapons/bladeslice.ogg'
flags = CONDUCT
armour_penetration = 100
origin_tech = "combat=4;magnets=3"
@@ -13,6 +13,7 @@
materials = list(MAT_GLASS=MINERAL_MATERIAL_AMOUNT)
attack_verb = list("stabbed", "slashed", "sliced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
armor = list("melee" = 100, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0)
/obj/item/weapon/shard/suicide_act(mob/user)
to_chat(viewers(user), pick("<span class='danger'>[user] is slitting \his wrists with \the [src]! It looks like \he's trying to commit suicide.</span>",
@@ -1,6 +1,7 @@
/obj/item/weapon/shield
name = "shield"
block_chance = 50
armor = list(melee = 50, bullet = 50, laser = 50, energy = 0, bomb = 30, bio = 0, rad = 0)
/obj/item/weapon/shield/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type)
if(attack_type == THROWN_PROJECTILE_ATTACK)
@@ -25,14 +25,40 @@
icon_state = "box"
item_state = "syringe_kit"
burn_state = FLAMMABLE
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
var/foldable = /obj/item/stack/sheet/cardboard
/obj/item/weapon/storage/box/attack_self(mob/user)
..()
if(!foldable)
return
if(contents.len)
to_chat(user, "<span class='warning'>You can't fold this box with items still inside!</span>")
return
if(!ispath(foldable))
return
// Close any open UI windows first
var/found = 0
for(var/mob/M in range(1))
if(M.s_active == src)
close(M)
if(M == user)
found = 1
if(!found) // User is too far away
return
to_chat(user, "<span class='notice'>You fold [src] flat.</span>")
var/obj/item/I = new foldable(get_turf(src))
user.put_in_hands(I)
qdel(src)
/obj/item/weapon/storage/box/large
name = "large box"
desc = "You could build a fort with this."
icon_state = "largebox"
w_class = 42 // Big, bulky.
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
foldable = /obj/item/stack/sheet/cardboard
storage_slots = 21
max_combined_w_class = 42 // 21*2
@@ -639,19 +665,16 @@
slot_flags = SLOT_BELT
can_hold = list(/obj/item/weapon/match)
New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/weapon/match(src)
/obj/item/weapon/storage/box/matches/New()
..()
for(var/i in 1 to storage_slots)
new /obj/item/weapon/match(src)
attackby(obj/item/weapon/match/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/match) && W.lit == 0)
W.lit = 1
W.icon_state = "match_lit"
processing_objects.Add(W)
playsound(user.loc, 'sound/goonstation/misc/matchstick_light.ogg', 50, 1)
W.update_icon()
return
/obj/item/weapon/storage/box/matches/attackby(obj/item/weapon/match/W, mob/user, params)
if(istype(W, /obj/item/weapon/match) && !W.lit)
W.matchignite()
playsound(user.loc, 'sound/goonstation/misc/matchstick_light.ogg', 50, 1)
return
/obj/item/weapon/storage/box/autoinjectors
name = "box of injectors"
@@ -681,7 +704,7 @@
icon_state = "light"
desc = "This box is shaped on the inside so that only light tubes and bulbs fit."
item_state = "syringe_kit"
foldable = /obj/item/stack/sheet/cardboard //BubbleWrap
foldable = /obj/item/stack/sheet/cardboard
storage_slots=21
can_hold = list(/obj/item/weapon/light/tube, /obj/item/weapon/light/bulb)
max_combined_w_class = 21
@@ -22,7 +22,6 @@
var/allow_quick_empty //Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.
var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
var/collection_mode = 1; //0 = pick one at a time, 1 = pick all on tile
var/foldable = null // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard
var/use_sound = "rustle" //sound played when used. null for no sound.
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
@@ -474,35 +473,12 @@
for(var/obj/O in contents)
O.hear_message(M, msg)
// BubbleWrap - A box can be folded up to make card
/obj/item/weapon/storage/attack_self(mob/user as mob)
/obj/item/weapon/storage/attack_self(mob/user)
//Clicking on itself will empty it, if it has the verb to do that.
if(user.is_in_active_hand(src))
if(src.verbs.Find(/obj/item/weapon/storage/verb/quick_empty))
src.quick_empty()
return
//Otherwise we'll try to fold it.
if( contents.len )
return
if( !ispath(src.foldable) )
return
var/found = 0
// Close any open UI windows first
for(var/mob/M in range(1))
if(M.s_active == src)
src.close(M)
if( M == user )
found = 1
if( !found ) // User is too far away
return
// Now make the cardboard
to_chat(user, "<span class='notice'>You fold [src] flat.</span>")
new src.foldable(get_turf(src))
qdel(src)
//BubbleWrap END
if(verbs.Find(/obj/item/weapon/storage/verb/quick_empty))
quick_empty()
//Returns the storage depth of an atom. This is the number of storage items the atom is contained in before reaching toplevel (the area).
//Returns -1 if the atom was not found on container.
@@ -7,9 +7,10 @@
/*
* Banhammer
*/
/obj/item/weapon/banhammer/attack(mob/M as mob, mob/user as mob)
/obj/item/weapon/banhammer/attack(mob/M, mob/user)
to_chat(M, "<font color='red'><b> You have been banned FOR NO REISIN by [user]<b></font>")
to_chat(user, "<font color='red'> You have <b>BANNED</b> [M]</font>")
playsound(loc, 'sound/effects/adminhelp.ogg', 15) //keep it at 15% volume so people don't jump out of their skin too much
/*
* Classic Baton
@@ -8,14 +8,12 @@
slot_flags = SLOT_BACK
hitsound = 'sound/weapons/smash.ogg'
w_class = WEIGHT_CLASS_NORMAL
pressure_resistance = ONE_ATMOSPHERE*5
force = 5.0
throwforce = 10.0
throw_speed = 1
throw_range = 4
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 10, bio = 0, rad = 0)
actions_types = list(/datum/action/item_action/set_internals)
var/datum/gas_mixture/air_contents = null
var/distribute_pressure = ONE_ATMOSPHERE
@@ -103,6 +103,7 @@ Frequency:
throw_range = 5
materials = list(MAT_METAL=10000)
origin_tech = "magnets=3;bluespace=4"
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 30, bio = 0, rad = 0)
var/active_portals = 0
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
@@ -545,6 +545,7 @@
throwforce = 15
throw_range = 1
w_class = WEIGHT_CLASS_HUGE
armor = list(melee = 50, bullet = 50, laser = 50, energy = 0, bomb = 50, bio = 0, rad = 0)
var/charged = 5
origin_tech = "combat=4;bluespace=4;plasmatech=7"
+154 -3
View File
@@ -1,6 +1,32 @@
//the essential proc to call when an obj must receive damage of any kind.
/obj/proc/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir, armour_penetration = 0)
if(sound_effect)
play_attack_sound(damage_amount, damage_type, damage_flag)
if(!(resistance_flags & INDESTRUCTIBLE) && obj_integrity > 0)
damage_amount = run_obj_armor(damage_amount, damage_type, damage_flag, attack_dir, armour_penetration)
if(damage_amount >= 0.1)
. = damage_amount
var/old_integ = obj_integrity
obj_integrity = max(old_integ - damage_amount, 0)
if(obj_integrity <= 0)
var/int_fail = integrity_failure
if(int_fail && old_integ > int_fail)
obj_break(damage_flag)
obj_destruction(damage_flag)
else if(integrity_failure)
if(obj_integrity <= integrity_failure)
obj_break(damage_flag)
/obj/proc/take_damage()
return
//returns the damage value of the attack after processing the obj's various armor protections
/obj/proc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir, armour_penetration = 0)
if(!(damage_type in list(BRUTE, BURN)))
return 0
var/armor_protection = 0
if(damage_flag)
armor_protection = armor[damage_flag]
if(armor_protection) //Only apply weak-against-armor/hollowpoint effects if there actually IS armor.
armor_protection = Clamp(armor_protection - armour_penetration, 0, 100)
return round(damage_amount * (100 - armor_protection) * 0.01, 0.1)
//the sound played when the obj is damaged.
/obj/proc/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
@@ -13,6 +39,95 @@
if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
/obj/hitby(atom/movable/AM)
..()
var/tforce = 0
if(ismob(AM))
tforce = 10
else if(istype(AM, /obj))
var/obj/O = AM
tforce = O.throwforce
take_damage(tforce, BRUTE, "melee", 1, get_dir(src, AM))
/obj/ex_act(severity, target)
if(resistance_flags & INDESTRUCTIBLE)
return
if(target == src)
obj_integrity = 0
qdel(src)
return
switch(severity)
if(1)
obj_integrity = 0
qdel(src)
if(2)
take_damage(rand(100, 250), BRUTE, "bomb", 0)
if(3)
take_damage(rand(10, 90), BRUTE, "bomb", 0)
/obj/bullet_act(obj/item/projectile/P)
. = ..()
playsound(src, P.hitsound, 50, 1)
visible_message("<span class='danger'>[src] is hit by \a [P]!</span>")
take_damage(P.damage, P.damage_type, P.flag, 0, turn(P.dir, 180), P.armour_penetration)
/obj/blob_act(obj/structure/blob/B)
if(isturf(loc))
var/turf/T = loc
if(T.intact && level == 1) //the blob doesn't destroy thing below the floor
return
take_damage(400, BRUTE, "melee", 0, get_dir(src, B))
/obj/proc/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, armor_penetration = 0) //used by attack_alien, attack_animal, and attack_slime
user.do_attack_animation(src)
user.changeNext_move(CLICK_CD_MELEE)
return take_damage(damage_amount, damage_type, damage_flag, sound_effect, get_dir(src, user), armor_penetration)
/obj/attack_alien(mob/living/carbon/alien/humanoid/user)
if(attack_generic(user, 60, BRUTE, "melee", 0))
playsound(loc, 'sound/weapons/slash.ogg', 100, 1)
/obj/attack_animal(mob/living/simple_animal/M)
if(!M.melee_damage_upper && !M.obj_damage)
M.custom_emote(1, "[M.friendly] [src]")
return 0
else
var/play_soundeffect = 1
if(M.environment_smash)
play_soundeffect = 0
if(M.obj_damage)
. = attack_generic(M, M.obj_damage, M.melee_damage_type, "melee", play_soundeffect, M.armour_penetration)
else
. = attack_generic(M, rand(M.melee_damage_lower,M.melee_damage_upper), M.melee_damage_type, "melee", play_soundeffect, M.armour_penetration)
if(. && !play_soundeffect)
playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1)
/obj/attack_slime(mob/living/carbon/slime/user)
if(!user.is_adult)
return
attack_generic(user, rand(10, 15), "melee", 1)
/obj/mech_melee_attack(obj/mecha/M)
M.do_attack_animation(src)
var/play_soundeffect = 0
var/mech_damtype = M.damtype
if(M.selected)
mech_damtype = M.selected.damtype
play_soundeffect = 1
else
switch(M.damtype)
if(BRUTE)
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
if(BURN)
playsound(src, 'sound/items/welder.ogg', 50, 1)
if(TOX)
playsound(src, 'sound/effects/spray2.ogg', 50, 1)
return 0
else
return 0
visible_message("<span class='danger'>[M.name] has hit [src].</span>")
return take_damage(M.force*3, mech_damtype, "melee", play_soundeffect, get_dir(src, M)) // multiplied by 3 so we can hit objs hard but not be overpowered against mobs.
/obj/singularity_act()
ex_act(1)
if(src && !qdeleted(src))
@@ -54,4 +169,40 @@
//the obj is deconstructed into pieces, whether through careful disassembly or when destroyed.
/obj/proc/deconstruct(disassembled = TRUE)
qdel(src)
qdel(src)
//what happens when the obj's health is below integrity_failure level.
/obj/proc/obj_break(damage_flag)
return
//what happens when the obj's integrity reaches zero.
/obj/proc/obj_destruction(damage_flag)
if(damage_flag == BURN)
burn()
else
deconstruct(FALSE)
//changes max_integrity while retaining current health percentage
//returns TRUE if the obj broke, FALSE otherwise
/obj/proc/modify_max_integrity(new_max, can_break = TRUE, damage_type = BRUTE, new_failure_integrity = null)
var/current_integrity = obj_integrity
var/current_max = max_integrity
if(current_integrity != 0 && current_max != 0)
var/percentage = current_integrity / current_max
current_integrity = max(1, round(percentage * new_max)) //don't destroy it as a result
obj_integrity = current_integrity
max_integrity = new_max
if(new_failure_integrity != null)
integrity_failure = new_failure_integrity
if(can_break && integrity_failure && current_integrity <= integrity_failure)
obj_break(damage_type)
return TRUE
return FALSE
//returns how much the object blocks an explosion
/obj/proc/GetExplosionBlock()
CRASH("Unimplemented GetExplosionBlock()")
+7 -3
View File
@@ -12,11 +12,13 @@
var/can_deconstruct = TRUE
var/damtype = "brute"
var/force = 0
var/list/armor
var/obj_integrity //defaults to max_integrity
var/max_integrity = 500
var/max_integrity = INFINITY
var/integrity_failure = 0 //0 if we have no special broken behavior
var/resistance_flags = NONE // INDESTRUCTIBLE
var/Mtoollink = 0 // variable to decide if an object should show the multitool menu linking menu, not all objects use it
var/burn_state = FIRE_PROOF // LAVA_PROOF | FIRE_PROOF | FLAMMABLE | ON_FIRE
@@ -28,7 +30,9 @@
var/force_blueprints = FALSE //forces the obj to be on the blueprints, regardless of when it was created.
/obj/New()
. = ..()
..()
if(!armor)
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
if(obj_integrity == null)
obj_integrity = max_integrity
if(on_blueprints && isturf(loc))
+22
View File
@@ -3,6 +3,7 @@
pressure_resistance = 8
var/climbable
var/mob/climber
var/broken = FALSE
/obj/structure/blob_act()
if(prob(50))
@@ -164,3 +165,24 @@
return 0
return 1
/obj/structure/examine(mob/user)
..()
if(!(resistance_flags & INDESTRUCTIBLE))
if(burn_state == ON_FIRE)
to_chat(user, "<span class='warning'>It's on fire!</span>")
if(broken)
to_chat(user, "<span class='notice'>It appears to be broken.</span>")
var/examine_status = examine_status(user)
if(examine_status)
to_chat(user, examine_status)
/obj/structure/proc/examine_status(mob/user) //An overridable proc, mostly for falsewalls.
var/healthpercent = (obj_integrity/max_integrity) * 100
switch(healthpercent)
if(50 to 99)
return "It looks slightly damaged."
if(25 to 50)
return "It appears heavily damaged."
if(0 to 25)
if(!broken)
return "<span class='warning'>It's falling apart!</span>"
+1 -4
View File
@@ -4,17 +4,14 @@
icon = 'icons/obj/barsigns.dmi'
icon_state = "empty"
req_access = list(access_bar)
armor = list(melee = 20, bullet = 20, laser = 20, energy = 100, bomb = 0, bio = 0, rad = 0)
var/list/barsigns=list()
var/list/hiddensigns
var/broken = 0
var/emagged = 0
var/state = 0
var/prev_sign = ""
var/panel_open = 0
/obj/structure/sign/barsign/New()
..()
@@ -4,12 +4,12 @@
icon = 'icons/obj/closet.dmi'
icon_state = "closed"
density = 1
armor = list(melee = 20, bullet = 10, laser = 10, energy = 0, bomb = 10, bio = 0, rad = 0)
var/icon_closed = "closed"
var/icon_opened = "open"
var/opened = 0
var/welded = 0
var/locked = 0
var/broken = 0
var/wall_mounted = 0 //never solid (You can always pass over it)
var/health = 100
var/lastbang
@@ -8,6 +8,7 @@
icon_opened = "fireaxe1100"
anchored = 1
density = 0
armor = list(melee = 50, bullet = 50, laser = 50, energy = 100, bomb = 10, bio = 100, rad = 100)
var/localopened = 0 //Setting this to keep it from behaviouring like a normal closet and obstructing movement in the map. -Agouri
opened = 1
var/hitstaken = 0
@@ -7,6 +7,7 @@
opened = 0
locked = 1
broken = 0
armor = list(melee = 30, bullet = 50, laser = 50, energy = 100, bomb = 0, bio = 0, rad = 0)
var/large = 1
icon_closed = "secure"
var/icon_locked = "secure1"
+2 -1
View File
@@ -18,6 +18,7 @@ var/global/list/captain_display_cases = list()
name = "display case frame"
icon = 'icons/obj/stock_parts.dmi'
icon_state = "box_glass"
armor = list(melee = 30, bullet = 0, laser = 0, energy = 0, bomb = 10, bio = 0, rad = 0)
var/obj/item/weapon/airlock_electronics/circuit = null
var/obj/item/device/assembly/prox_sensor/sensor = null
var/state = DISPLAYCASE_FRAME_CIRCUIT
@@ -116,7 +117,7 @@ var/global/list/captain_display_cases = list()
/obj/structure/displaycase/captains_laser
name = "captain's display case"
desc = "A display case for the captain's antique laser gun. Hooked up with an anti-theft system."
burglar_alarm = 1
burglar_alarm = 1
locked = 1
req_access = list(access_captain)
start_showpiece_type = /obj/item/weapon/gun/energy/laser/captain
+12 -11
View File
@@ -4,15 +4,16 @@
icon_state = "construction"
anchored = FALSE
density = TRUE
max_integrity = 200
var/overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
var/state = AIRLOCK_ASSEMBLY_NEEDS_WIRES
var/mineral = null
var/mineral
var/base_name = "airlock"
var/obj/item/weapon/airlock_electronics/electronics = null
var/obj/item/weapon/airlock_electronics/electronics
var/airlock_type = /obj/machinery/door/airlock //the type path of the airlock once completed
var/glass_type = /obj/machinery/door/airlock/glass
var/glass = 0 // 0 = glass can be installed. 1 = glass is already installed.
var/created_name = null
var/created_name
var/heat_proof_finished = 0 //whether to heat-proof the finished airlock
var/previous_assembly = /obj/structure/door_assembly
var/noglass = FALSE //airlocks with no glass version, also cannot be modified with sheets
@@ -116,12 +117,12 @@
else if(iscoil(W) && state == AIRLOCK_ASSEMBLY_NEEDS_WIRES && anchored)
var/obj/item/stack/cable_coil/coil = W
if (coil.amount < 1)
if(coil.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one length of cable to wire the airlock assembly!</span>")
return
user.visible_message("[user] wires the airlock assembly.", "You start to wire the airlock assembly...")
if(do_after(user, 40 * coil.toolspeed, target = src))
if(coil.amount < 1 || state != AIRLOCK_ASSEMBLY_NEEDS_WIRES)
if(coil.get_amount() < 1 || state != AIRLOCK_ASSEMBLY_NEEDS_WIRES)
return
coil.use(1)
state = AIRLOCK_ASSEMBLY_NEEDS_ELECTRONICS
@@ -173,14 +174,14 @@
else if(istype(W, /obj/item/stack/sheet) && (!glass || !mineral))
var/obj/item/stack/sheet/S = W
if(S)
if(S.amount>=1)
if(S.get_amount() >= 1)
if(!noglass)
if(!glass)
if(istype(S, /obj/item/stack/sheet/rglass) || istype(S, /obj/item/stack/sheet/glass))
playsound(loc, S.usesound, 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly...")
if(do_after(user, 40 * S.toolspeed, target = src))
if(S.amount < 1 || glass)
if(S.get_amount() < 1 || glass)
return
if(S.type == /obj/item/stack/sheet/rglass)
to_chat(user, "<span class='notice'>You install reinforced glass windows into the airlock assembly.</span>")
@@ -192,11 +193,11 @@
if(!mineral)
if(istype(S, /obj/item/stack/sheet/mineral) && S.sheettype)
var/M = S.sheettype
if(S.amount>=2)
if(S.get_amount() >= 2)
playsound(loc, S.usesound, 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly...")
if(do_after(user, 40 * S.toolspeed, target = src))
if(S.amount < 2 || mineral)
if(S.get_amount() < 2 || mineral)
return
to_chat(user, "<span class='notice'>You install [M] plating into the airlock assembly.</span>")
S.use(2)
@@ -204,7 +205,7 @@
var/obj/structure/door_assembly/MA = new mineralassembly(loc)
transfer_assembly_vars(src, MA, TRUE)
else
to_chat(user, "<span class='warning'>You need at least two sheets add a mineral cover!</span>")
to_chat(user, "<span class='warning'>You need at least two sheets to add a mineral cover!</span>")
else
to_chat(user, "<span class='warning'>You cannot add [S] to [src]!</span>")
else
@@ -239,7 +240,7 @@
electronics.forceMove(door)
qdel(src)
else
..()
return ..()
update_name()
update_icon()
@@ -95,6 +95,7 @@
health = 160
reinf = 1
explosion_block = 3
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 50, "bio" = 100, "rad" = 100)
/obj/structure/window/full/shuttle/New()
..()
+2 -2
View File
@@ -32,8 +32,8 @@
/obj/structure/girder/attack_animal(mob/living/simple_animal/M)
M.changeNext_move(CLICK_CD_MELEE)
M.do_attack_animation(src)
if(M.environment_smash >= 1)
if(M.environment_smash == 3)
if((M.environment_smash & ENVIRONMENT_SMASH_STRUCTURES) || (M.environment_smash & ENVIRONMENT_SMASH_WALLS) || (M.environment_smash & ENVIRONMENT_SMASH_RWALLS))
if(M.environment_smash & ENVIRONMENT_SMASH_RWALLS)
ex_act(2)
M.visible_message("<span class='warning'>[M] smashes through \the [src].</span>", "<span class='warning'>You smash through \the [src].</span>")
else
+68 -71
View File
@@ -1,25 +1,25 @@
/obj/structure/grille
desc = "A flimsy lattice of metal rods, with screws to secure it to the floor."
desc = "A flimsy framework of metal rods."
name = "grille"
icon = 'icons/obj/structures.dmi'
icon_state = "grille"
density = 1
anchored = 1
density = TRUE
anchored = TRUE
flags = CONDUCT
pressure_resistance = 5*ONE_ATMOSPHERE
layer = BELOW_OBJ_LAYER
level = 3
var/health = 10
var/broken = 0
armor = list(melee = 50, bullet = 70, laser = 70, energy = 100, bomb = 10, bio = 100, rad = 100)
max_integrity = 50
integrity_failure = 20
var/rods_type = /obj/item/stack/rods
var/rods_amount = 2
var/rods_broken = 1
var/grille_type = null
var/grille_type
var/broken_type = /obj/structure/grille/broken
/obj/structure/grille/fence/
var/width = 3
health = 50
/obj/structure/grille/fence/New()
if(width > 1)
@@ -51,6 +51,20 @@
if(!broken)
obj_break()
/obj/structure/grille/examine(mob/user)
..()
if(anchored)
to_chat(user, "<span class='notice'>It's secured in place with <b>screws</b>. The rods look like they could be <b>cut</b> through.</span>")
if(!anchored)
to_chat(user, "<span class='notice'>The anchoring screws are <i>unscrewed</i>. The rods look like they could be <b>cut</b> through.</span>")
/obj/structure/grille/ratvar_act()
if(broken)
new /obj/structure/grille/ratvar/broken(loc)
else
new /obj/structure/grille/ratvar(loc)
qdel(src)
/obj/structure/grille/Bumped(atom/user)
if(ismob(user))
shock(user, 70)
@@ -65,9 +79,9 @@
if(shock(user, 70))
return
if(HULK in user.mutations)
take_damage(5)
take_damage(60, BRUTE, "melee", 1)
else
take_damage(rand(1,2))
take_damage(rand(5,10), BRUTE, "melee", 1)
/obj/structure/grille/attack_alien(mob/living/user)
if(istype(user, /mob/living/carbon/alien/larva))
@@ -79,37 +93,7 @@
"You hear twisting metal.")
if(!shock(user, 70))
take_damage(5)
/obj/structure/grille/attack_slime(mob/living/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
var/mob/living/carbon/slime/S = user
if(!S.is_adult)
return
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
user.visible_message("<span class='warning'>[user] smashes against [src].</span>", \
"<span class='warning'>You smash against [src].</span>", \
"You hear twisting metal.")
take_damage(rand(1,2))
/obj/structure/grille/attack_animal(mob/living/simple_animal/M)
if(M.melee_damage_upper == 0 || (M.melee_damage_type != BRUTE && M.melee_damage_type != BURN))
return
M.changeNext_move(CLICK_CD_MELEE)
M.do_attack_animation(src)
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
M.visible_message("<span class='warning'>[M] smashes against [src].</span>", \
"<span class='warning'>You smash against [src].</span>", \
"You hear twisting metal.")
take_damage(rand(M.melee_damage_lower,M.melee_damage_upper), M.melee_damage_type)
/obj/structure/grille/mech_melee_attack(obj/mecha/M)
if(..())
take_damage(M.force * 0.5, M.damtype)
take_damage(20, BRUTE, "melee", 1)
/obj/structure/grille/CanPass(atom/movable/mover, turf/target, height=0)
if(height==0)
@@ -128,10 +112,6 @@
var/atom/movable/mover = caller
. = . || mover.checkpass(PASSGRILLE)
/obj/structure/grille/bullet_act(obj/item/projectile/Proj)
. = ..()
take_damage(Proj.damage*0.3, Proj.damage_type)
/obj/structure/grille/attackby(obj/item/weapon/W, mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
add_fingerprint(user)
@@ -141,7 +121,7 @@
deconstruct()
else if((isscrewdriver(W)) && (istype(loc, /turf/simulated) || anchored))
if(!shock(user, 90))
playsound(loc, W.usesound, 100, 1)
playsound(src, W.usesound, 100, 1)
anchored = !anchored
user.visible_message("<span class='notice'>[user] [anchored ? "fastens" : "unfastens"] [src].</span>", \
"<span class='notice'>You [anchored ? "fasten [src] to" : "unfasten [src] from"] the floor.</span>")
@@ -163,7 +143,7 @@
//window placing end
else if(istype(W, /obj/item/weapon/shard) || !shock(user, 70))
return attacked_by(W, user)
return ..()
/obj/structure/grille/proc/build_window(obj/item/stack/sheet/S, mob/user)
if(!istype(S) || !user)
@@ -234,7 +214,7 @@
W.update_icon()
return
/obj/structure/grille/proc/attacked_by(obj/item/I, mob/living/user)
/obj/structure/grille/attacked_by(obj/item/I, mob/living/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if(!(I.flags&NOBLUDGEON))
@@ -259,25 +239,15 @@
var/obj/R = new rods_type(loc, rods_amount)
transfer_fingerprints_to(R)
qdel(src)
..()
/obj/structure/grille/proc/obj_break()
/obj/structure/grille/obj_break()
if(!broken && can_deconstruct)
new broken_type(loc)
var/obj/R = new rods_type(loc, rods_broken)
transfer_fingerprints_to(R)
qdel(src)
/obj/structure/grille/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
if(sound_effect)
play_attack_sound(damage_amount, damage_type, damage_flag)
health -= damage_amount
if(health <= 0)
if(!broken)
obj_break()
else
if(health <= -6)
deconstruct()
// shock user with probability prb (if all connections & power are working)
// returns 1 if shocked, 0 otherwise
@@ -303,33 +273,60 @@
/obj/structure/grille/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(!broken)
if(exposed_temperature > T0C + 1500)
take_damage(1)
take_damage(1, BURN, 0, 0)
..()
/obj/structure/grille/hitby(atom/movable/AM)
..()
var/tforce = 0
if(ismob(AM))
tforce = 5
else if(isobj(AM))
if(prob(50))
var/obj/O = AM
tforce = max(0, O.throwforce * 0.5)
else if(anchored && !broken)
if(istype(AM, /obj))
if(prob(50) && anchored && !broken)
var/turf/T = get_turf(src)
var/obj/structure/cable/C = T.get_cable_node()
if(C)
playsound(loc, 'sound/magic/LightningShock.ogg', 100, 1, extrarange = 5)
tesla_zap(src, 3, C.powernet.avail * 0.01) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot.
C.powernet.load += C.powernet.avail * 0.0375 // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock.
take_damage(tforce)
return ..()
/obj/structure/grille/broken // Pre-broken grilles for map placement
icon_state = "brokengrille"
density = 0
health = 0
obj_integrity = 20
broken = 1
rods_amount = 1
rods_broken = 0
grille_type = /obj/structure/grille
broken_type = null
/obj/structure/grille/ratvar
icon_state = "ratvargrille"
name = "cog grille"
desc = "A strangely-shaped grille."
broken_type = /obj/structure/grille/ratvar/broken
/obj/structure/grille/ratvar/New()
..()
if(broken)
new /obj/effect/temp_visual/ratvar/grille/broken(get_turf(src))
else
new /obj/effect/temp_visual/ratvar/grille(get_turf(src))
new /obj/effect/temp_visual/ratvar/beam/grille(get_turf(src))
/obj/structure/grille/ratvar/narsie_act()
take_damage(rand(1, 3), BRUTE)
if(src)
var/previouscolor = color
color = "#960000"
animate(src, color = previouscolor, time = 8)
/obj/structure/grille/ratvar/ratvar_act()
return
/obj/structure/grille/ratvar/broken
icon_state = "brokenratvargrille"
density = FALSE
obj_integrity = 20
broken = TRUE
rods_amount = 1
rods_broken = 0
grille_type = /obj/structure/grille/ratvar
broken_type = null
+1 -1
View File
@@ -66,7 +66,7 @@
add_fingerprint(user)
return
/obj/structure/inflatable/proc/attack_generic(mob/user as mob, damage = 0) //used by attack_alien, attack_animal, and attack_slime
/obj/structure/inflatable/attack_generic(mob/user, damage = 0) //used by attack_alien, attack_animal, and attack_slime
health -= damage
if(health <= 0)
user.visible_message("<span class='danger'>[user] tears open [src]!</span>")
+1
View File
@@ -5,6 +5,7 @@
icon_state = "latticefull"
density = 0
anchored = 1.0
armor = list(melee = 50, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
layer = 2.3 //under pipes
// flags = CONDUCT
@@ -7,7 +7,7 @@
icon = 'icons/obj/doors/mineral_doors.dmi'
icon_state = "metal"
armor = list(melee = 10, bullet = 0, laser = 0, energy = 100, bomb = 10, bio = 100, rad = 100)
var/initial_state
var/state = 0 //closed, 1 == open
var/isSwitchingStates = 0
@@ -141,7 +141,7 @@
else
attacked_by(W, user)
/obj/structure/mineral_door/proc/attacked_by(obj/item/I, mob/user)
/obj/structure/mineral_door/attacked_by(obj/item/I, mob/user)
if(I.damtype != STAMINA)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
@@ -6,6 +6,7 @@
density = 0
anchored = 1
layer = 4
armor = list(melee = 100, bullet = 80, laser = 80, energy = 100, bomb = 50, bio = 100, rad = 100)
var/list/mobs_can_pass = list(
/mob/living/carbon/slime,
/mob/living/simple_animal/mouse,
+1
View File
@@ -4,6 +4,7 @@
opacity = 0
density = 0
layer = 3.5
armor = list(melee = 50, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
/obj/structure/sign/ex_act(severity)
switch(severity)
@@ -128,6 +128,7 @@
desc = "Four pieces of brass arranged in a square. It's slightly warm to the touch."
icon_state = "brass_frame"
burn_state = FIRE_PROOF
unacidable = 1
framestack = /obj/item/stack/tile/brass
framestackamount = 1
+21 -108
View File
@@ -82,42 +82,6 @@
new /obj/structure/table/reinforced/brass(loc)
qdel(src)
/obj/structure/table/ex_act(severity)
switch(severity)
if(1)
qdel(src)
return
if(2)
if(prob(50))
qdel(src)
return
if(3)
if(prob(25))
deconstruct(FALSE)
else
return
/obj/structure/table/blob_act()
if(prob(75))
qdel(src)
/obj/structure/table/attack_alien(mob/living/user)
user.do_attack_animation(src)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1)
visible_message("<span class='danger'>[user] slices [src] apart!</span>")
deconstruct(FALSE)
/obj/structure/table/mech_melee_attack(obj/mecha/M)
visible_message("<span class='danger'>[M] smashes [src] apart!</span>")
deconstruct(FALSE)
/obj/structure/table/attack_animal(mob/living/simple_animal/user)
if(user.environment_smash)
user.do_attack_animation(src)
playsound(loc, 'sound/weapons/Genhit.ogg', 50, 1)
visible_message("<span class='danger'>[user] smashes [src] apart!</span>")
deconstruct(FALSE)
/obj/structure/table/attack_hand(mob/living/user)
if(HULK in user.mutations)
user.do_attack_animation(src)
@@ -254,18 +218,7 @@
if(isrobot(user))
return
if(istype(I, /obj/item/weapon/melee/energy/blade))
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(5, 0, loc)
spark_system.start()
playsound(loc, I.usesound, 50, 1)
playsound(loc, "sparks", 50, 1)
for(var/mob/O in viewers(user, 4))
O.show_message("<span class='notice'>The [src] was sliced apart by [user]!</span>", 1, "<span class='warning'>You hear [src] coming apart.</span>", 2)
deconstruct(FALSE)
return
if(!(I.flags & ABSTRACT))
if(user.a_intent != INTENT_HARM && !(I.flags & ABSTRACT))
if(user.drop_item())
I.Move(loc)
var/list/click_params = params2list(params)
@@ -275,8 +228,8 @@
//Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
I.pixel_x = Clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
I.pixel_y = Clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
return
else
return ..()
/obj/structure/table/deconstruct(disassembled = TRUE, wrench_disassembly = 0)
if(can_deconstruct)
@@ -401,6 +354,7 @@
icon_state = "glass_table"
buildstack = /obj/item/stack/sheet/glass
max_integrity = 70
unacidable = 1
canSmoothWith = null
var/list/debris = list()
@@ -465,6 +419,11 @@
debris -= AM
qdel(src)
/obj/structure/table/glass/narsie_act()
color = NARSIE_WINDOW_COLOUR
for(var/obj/item/weapon/shard/S in debris)
S.color = NARSIE_WINDOW_COLOUR
/*
* Wooden tables
*/
@@ -534,6 +493,7 @@
canSmoothWith = list(/obj/structure/table/reinforced, /obj/structure/table)
max_integrity = 200
integrity_failure = 50
armor = list(melee = 10, bullet = 30, laser = 30, energy = 100, bomb = 20, bio = 0, rad = 0)
/obj/structure/table/reinforced/deconstruction_hints(mob/user)
if(deconstruction_ready)
@@ -601,8 +561,8 @@
icon = 'icons/obj/objects.dmi'
icon_state = "rack"
layer = TABLE_LAYER
density = 1
anchored = 1
density = TRUE
anchored = TRUE
pass_flags = LETPASSTHROW
max_integrity = 20
@@ -610,28 +570,6 @@
..()
to_chat(user, "<span class='notice'>It's held together by a couple of <b>bolts</b>.</span>")
/obj/structure/rack/ex_act(severity)
switch(severity)
if(1)
qdel(src)
if(2)
qdel(src)
if(prob(50))
new /obj/item/weapon/rack_parts(loc)
if(3)
if(prob(25))
qdel(src)
new /obj/item/weapon/rack_parts(loc)
/obj/structure/rack/blob_act()
if(prob(75))
qdel(src)
return
else if(prob(50))
new /obj/item/weapon/rack_parts(loc)
qdel(src)
return
/obj/structure/rack/CanPass(atom/movable/mover, turf/target, height=0)
if(height==0)
return 1
@@ -667,46 +605,21 @@
return
if(isrobot(user))
return
if(user.a_intent == INTENT_HARM)
return ..()
if(!(W.flags & ABSTRACT))
if(user.drop_item())
W.Move(loc)
return
/obj/structure/rack/attack_hand(mob/user)
if(HULK in user.mutations)
visible_message("<span class='danger'>[user] smashes [src] apart!</span>")
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
deconstruct()
else
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
playsound(loc, 'sound/items/dodgeball.ogg', 80, 1)
user.visible_message("<span class='warning'>[user] kicks [src].</span>", \
"<span class='danger'>You kick [src].</span>")
obj_integrity -= rand(1,2)
healthcheck()
/obj/structure/rack/mech_melee_attack(obj/mecha/M)
visible_message("<span class='danger'>[M] smashes [src] apart!</span>")
deconstruct()
/obj/structure/rack/attack_alien(mob/living/user)
/obj/structure/rack/attack_hand(mob/living/user)
if(user.weakened || user.resting || user.lying)
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
visible_message("<span class='danger'>[user] slices [src] apart!</span>")
deconstruct()
/obj/structure/rack/attack_animal(mob/living/simple_animal/user)
if(user.environment_smash)
user.do_attack_animation(src)
visible_message("<span class='danger'>[user] smashes [src] apart!</span>")
deconstruct()
/obj/structure/rack/attack_tk() // no telehulk sorry
return
/obj/structure/rack/proc/healthcheck()
if(obj_integrity <= 0)
deconstruct()
user.visible_message("<span class='warning'>[user] kicks [src].</span>", \
"<span class='danger'>You kick [src].</span>")
take_damage(rand(4,8), BRUTE, "melee", 1)
/obj/structure/rack/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
+126 -130
View File
@@ -9,38 +9,41 @@
*/
obj/structure/windoor_assembly
/obj/structure/windoor_assembly
icon = 'icons/obj/doors/windoor.dmi'
name = "windoor Assembly"
name = "windoor assembly"
icon_state = "l_windoor_assembly01"
anchored = 0
density = 0
desc = "A small glass and wire assembly for windoors."
anchored = FALSE
density = FALSE
dir = NORTH
max_integrity = 300
var/ini_dir
var/obj/item/weapon/airlock_electronics/electronics = null
var/created_name = null
var/obj/item/weapon/airlock_electronics/electronics
var/created_name
//Vars to help with the icon's name
var/facing = "l" //Does the windoor open to the left or right?
var/secure = 0 //Whether or not this creates a secure windoor
var/secure = FALSE //Whether or not this creates a secure windoor
var/state = "01" //How far the door assembly has progressed
obj/structure/windoor_assembly/New(dir=NORTH)
obj/structure/windoor_assembly/New(loc, set_dir)
..()
src.ini_dir = src.dir
if(set_dir)
dir = set_dir
ini_dir = dir
air_update_turf(1)
obj/structure/windoor_assembly/Destroy()
density = 0
density = FALSE
QDEL_NULL(electronics)
air_update_turf(1)
return ..()
/obj/structure/windoor_assembly/Move()
var/turf/T = loc
..()
. = ..()
setDir(ini_dir)
move_update_air(T)
/obj/structure/windoor_assembly/update_icon()
@@ -54,13 +57,13 @@ obj/structure/windoor_assembly/Destroy()
else
return 1
/obj/structure/windoor_assembly/CanAtmosPass(var/turf/T)
/obj/structure/windoor_assembly/CanAtmosPass(turf/T)
if(get_dir(loc, T) == dir)
return !density
else
return 1
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover as mob|obj, turf/target as turf)
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover, turf/target)
if(istype(mover) && mover.checkpass(PASSGLASS))
return 1
if(get_dir(loc, target) == dir)
@@ -69,166 +72,166 @@ obj/structure/windoor_assembly/Destroy()
return 1
/obj/structure/windoor_assembly/attackby(obj/item/W as obj, mob/user as mob, params)
/obj/structure/windoor_assembly/attackby(obj/item/W, mob/user, params)
//I really should have spread this out across more states but thin little windoors are hard to sprite.
add_fingerprint(user)
switch(state)
if("01")
if(istype(W, /obj/item/weapon/weldingtool) && !anchored )
if(iswelder(W) && !anchored)
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0,user))
user.visible_message("<span class='warning'>[user] dissassembles the windoor assembly.</span>", "<span class='notice'>You start to dissassemble the windoor assembly.</span>")
playsound(src.loc, WT.usesound, 50, 1)
user.visible_message("<span class='warning'>[user] disassembles the windoor assembly.</span>", "<span class='notice'>You start to disassemble the windoor assembly...</span>")
playsound(loc, 'sound/items/welder2.ogg', 50, 1)
if(do_after(user, 40 * WT.toolspeed, target = src))
if(!src || !WT.isOn()) return
to_chat(user, "<span class='notice'>You dissasembled the windoor assembly!</span>")
if(!src || !WT.isOn())
return
to_chat(user, "<span class='notice'>You disassemble the windoor assembly.</span>")
var/obj/item/stack/sheet/rglass/RG = new (get_turf(src), 5)
RG.add_fingerprint(user)
if(secure)
var/obj/item/stack/rods/R = new (get_turf(src), 4)
R.add_fingerprint(user)
qdel(src)
else
return
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
if(istype(W, /obj/item/weapon/wrench) && !anchored)
for(var/obj/machinery/door/window/WD in src.loc)
if(WD.dir == src.dir)
to_chat(user, "<span class='warning'>There is already a windoor in that location.</span>")
if(iswrench(W) && !anchored)
for(var/obj/machinery/door/window/WD in loc)
if(WD.dir == dir)
to_chat(user, "<span class='warning'>There is already a windoor in that location!</span>")
return
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor.")
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] secures the windoor assembly to the floor.", "You start to secure the windoor assembly to the floor...")
if(do_after(user, 40 * W.toolspeed, target = src))
if(!src || src.anchored)
if(!src || anchored)
return
for(var/obj/machinery/door/window/WD in src.loc)
if(WD.dir == src.dir)
to_chat(user, "<span class='warning'>There is already a windoor in that location.</span>")
for(var/obj/machinery/door/window/WD in loc)
if(WD.dir == dir)
to_chat(user, "<span class='warning'>There is already a windoor in that location!</span>")
return
to_chat(user, "<span class='notice'>You've secured the windoor assembly!</span>")
src.anchored = 1
if(src.secure)
src.name = "secure anchored windoor assembly"
to_chat(user, "<span class='notice'>You secure the windoor assembly.</span>")
anchored = TRUE
if(secure)
name = "secure anchored windoor assembly"
else
src.name = "anchored windoor assembly"
name = "anchored windoor assembly"
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
else if(istype(W, /obj/item/weapon/wrench) && anchored)
else if(iswrench(W) && anchored)
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] unsecures the windoor assembly to the floor.", "You start to unsecure the windoor assembly to the floor.")
user.visible_message("[user] unsecures the windoor assembly from the floor.", "You start to unsecure the windoor assembly from the floor...")
if(do_after(user, 40 * W.toolspeed, target = src))
if(!src || !src.anchored)
if(!src || !anchored)
return
to_chat(user, "<span class='notice'>You've unsecured the windoor assembly!</span>")
src.anchored = 0
if(src.secure)
src.name = "secure windoor assembly"
to_chat(user, "<span class='notice'>You unsecure the windoor assembly.</span>")
anchored = FALSE
if(secure)
name = "secure windoor assembly"
else
src.name = "windoor assembly"
name = "windoor assembly"
//Adding plasteel makes the assembly a secure windoor assembly. Step 2 (optional) complete.
else if(istype(W, /obj/item/stack/sheet/plasteel) && !secure)
var/obj/item/stack/sheet/plasteel/P = W
if(P.amount < 2)
to_chat(user, "<span class='danger'>You need more plasteel to do this.</span>")
if(P.get_amount() < 2)
to_chat(user, "<span class='warning'>You need more plasteel to do this!</span>")
return
to_chat(user, "<span class='notice'>You start to reinforce the windoor with plasteel.</span>")
to_chat(user, "<span class='notice'>You start to reinforce the windoor with plasteel...</span>")
if(do_after(user, 40 * P.toolspeed, target = src))
if(!src || secure)
if(!src || secure || P.get_amount() < 2)
return
playsound(loc, P.usesound, 100, 1)
P.use(2)
to_chat(user, "<span class='notice'>You reinforce the windoor.</span>")
src.secure = 1
if(src.anchored)
src.name = "secure anchored windoor assembly"
secure = TRUE
if(anchored)
name = "secure anchored windoor assembly"
else
src.name = "secure windoor assembly"
name = "secure windoor assembly"
//Adding cable to the assembly. Step 5 complete.
else if(istype(W, /obj/item/stack/cable_coil) && anchored)
user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly.")
else if(iscoil(W) && anchored)
user.visible_message("[user] wires the windoor assembly.", "You start to wire the windoor assembly...")
if(do_after(user, 40 * W.toolspeed, target = src))
if(!src || !src.anchored || src.state != "01")
if(!src || !anchored || state != "01")
return
var/obj/item/stack/cable_coil/CC = W
CC.use(1)
to_chat(user, "<span class='notice'>You wire the windoor!</span>")
to_chat(user, "<span class='notice'>You wire the windoor.</span>")
playsound(loc, CC.usesound, 100, 1)
src.state = "02"
if(src.secure)
src.name = "secure wired windoor assembly"
state = "02"
if(secure)
name = "secure wired windoor assembly"
else
src.name = "wired windoor assembly"
name = "wired windoor assembly"
else
..()
return ..()
if("02")
//Removing wire from the assembly. Step 5 undone.
if(istype(W, /obj/item/weapon/wirecutters))
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly.")
if(iswirecutter(W))
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] cuts the wires from the airlock assembly.", "You start to cut the wires from airlock assembly...")
if(do_after(user, 40 * W.toolspeed, target = src))
if(!src || src.state != "02")
if(!src || state != "02")
return
to_chat(user, "<span class='notice'>You cut the windoor wires!</span>")
to_chat(user, "<span class='notice'>You cut the windoor wires.</span>")
new/obj/item/stack/cable_coil(get_turf(user), 1)
src.state = "01"
if(src.secure)
src.name = "secure anchored windoor assembly"
state = "01"
if(secure)
name = "secure anchored windoor assembly"
else
src.name = "anchored windoor assembly"
name = "anchored windoor assembly"
//Adding airlock electronics for access. Step 6 complete.
else if(istype(W, /obj/item/weapon/airlock_electronics))
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly...")
user.drop_item()
W.loc = src
W.forceMove(src)
if(do_after(user, 40 * W.toolspeed, target = src))
if(!src || src.electronics)
W.loc = src.loc
if(!src || electronics)
W.forceMove(loc)
return
to_chat(user, "<span class='notice'>You've installed the airlock electronics!</span>")
src.name = "near finished windoor assembly"
src.electronics = W
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
name = "near finished windoor assembly"
electronics = W
else
W.loc = src.loc
W.forceMove(loc)
//Screwdriver to remove airlock electronics. Step 6 undone.
else if(istype(W, /obj/item/weapon/screwdriver))
else if(isscrewdriver(W))
if(!electronics)
return
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly.")
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to uninstall electronics from the airlock assembly...")
if(do_after(user, 40 * W.toolspeed, target = src))
if(!src || !electronics)
return
to_chat(user, "<span class='notice'>You've removed the airlock electronics!</span>")
src.name = "wired windoor assembly"
to_chat(user, "<span class='notice'>You remove the airlock electronics.</span>")
name = "wired windoor assembly"
var/obj/item/weapon/airlock_electronics/ae
ae = electronics
electronics = null
ae.loc = src.loc
ae.forceMove(loc)
else if(istype(W, /obj/item/weapon/pen))
var/t = stripped_input(user, "Enter the name for the door.", src.name, src.created_name,MAX_NAME_LEN)
var/t = stripped_input(user, "Enter the name for the door.", name, created_name,MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)
if(!in_range(src, usr) && loc != usr)
return
created_name = t
return
@@ -236,70 +239,68 @@ obj/structure/windoor_assembly/Destroy()
//Crowbar to complete the assembly, Step 7 complete.
else if(istype(W, /obj/item/weapon/crowbar))
if(!src.electronics)
to_chat(usr, "<span class='danger'>The assembly is missing electronics.</span>")
else if(iscrowbar(W))
if(!electronics)
to_chat(usr, "<span class='warning'>The assembly is missing electronics!</span>")
return
usr << browse(null, "window=windoor_access")
playsound(src.loc, W.usesound, 100, 1)
user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame.")
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] pries the windoor into the frame.", "You start prying the windoor into the frame...")
if(do_after(user, 40 * W.toolspeed, target = src))
if(src.loc && src.electronics)
if(loc && electronics)
for(var/obj/machinery/door/window/WD in loc)
if(WD.dir == dir)
return
density = 1 //Shouldn't matter but just incase
to_chat(user, "<span class='notice'>You finish the windoor!</span>")
density = TRUE //Shouldn't matter but just incase
to_chat(user, "<span class='notice'>You finish the windoor.</span>")
if(secure)
var/obj/machinery/door/window/brigdoor/windoor = new /obj/machinery/door/window/brigdoor(src.loc)
if(src.facing == "l")
if(facing == "l")
windoor.icon_state = "leftsecureopen"
windoor.base_state = "leftsecure"
else
windoor.icon_state = "rightsecureopen"
windoor.base_state = "rightsecure"
windoor.dir = src.dir
windoor.density = 0
windoor.setDir(dir)
windoor.density = FALSE
if(src.electronics.one_access)
windoor.req_one_access = src.electronics.conf_access
if(electronics.one_access)
windoor.req_one_access = electronics.conf_access
else
windoor.req_access = src.electronics.conf_access
windoor.req_access = electronics.conf_access
windoor.electronics = src.electronics
src.electronics.loc = windoor
electronics.forceMove(windoor)
if(created_name)
windoor.name = created_name
qdel(src)
windoor.close()
else
var/obj/machinery/door/window/windoor = new /obj/machinery/door/window(src.loc)
if(src.facing == "l")
var/obj/machinery/door/window/windoor = new /obj/machinery/door/window(loc)
if(facing == "l")
windoor.icon_state = "leftopen"
windoor.base_state = "left"
else
windoor.icon_state = "rightopen"
windoor.base_state = "right"
windoor.dir = src.dir
windoor.density = 0
windoor.setDir(dir)
windoor.density = FALSE
windoor.req_access = src.electronics.conf_access
windoor.req_access = electronics.conf_access
windoor.electronics = src.electronics
src.electronics.loc = windoor
electronics.forceMove(windoor)
if(created_name)
windoor.name = created_name
qdel(src)
windoor.close()
qdel(src)
else
..()
return ..()
//Update to reflect changes(if applicable)
update_icon()
@@ -312,28 +313,23 @@ obj/structure/windoor_assembly/Destroy()
set src in oview(1)
if(usr.stat || !usr.canmove || usr.restrained())
return
if(src.anchored)
if(anchored)
to_chat(usr, "It is fastened to the floor; therefore, you can't rotate it!")
return 0
//if(src.state != "01")
//update_nearby_tiles(need_rebuild=1) //Compel updates before
src.dir = turn(src.dir, 270)
//if(src.state != "01")
//update_nearby_tiles(need_rebuild=1)
src.ini_dir = src.dir
setDir(turn(dir, 270))
ini_dir = dir
update_icon()
return
return TRUE
/obj/structure/windoor_assembly/AltClick(mob/user)
..()
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!Adjacent(user))
if(!in_range(src, user))
return
revrotate()
else
revrotate()
//Flips the windoor assembly, determines whather the door opens to the left or the right
/obj/structure/windoor_assembly/verb/flip()
@@ -343,11 +339,11 @@ obj/structure/windoor_assembly/Destroy()
if(usr.stat || !usr.canmove || usr.restrained())
return
if(src.facing == "l")
if(facing == "l")
to_chat(usr, "The windoor will now slide to the right.")
src.facing = "r"
facing = "r"
else
src.facing = "l"
facing = "l"
to_chat(usr, "The windoor will now slide to the left.")
update_icon()
+4 -2
View File
@@ -148,7 +148,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
return
/obj/structure/window/proc/attack_generic(mob/living/user as mob, damage = 0) //used by attack_alien, attack_animal, and attack_slime
/obj/structure/window/attack_generic(mob/living/user, damage = 0) //used by attack_alien, attack_animal, and attack_slime
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
health -= damage
@@ -446,6 +446,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
shardtype = /obj/item/weapon/shard/plasma
glasstype = /obj/item/stack/sheet/plasmaglass
health = 120
armor = list("melee" = 75, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100)
/obj/structure/window/plasmabasic/New(Loc,re=0)
..()
@@ -474,7 +475,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
glasstype = /obj/item/stack/sheet/plasmaglass
reinf = 1
health = 160
armor = list("melee" = 85, "bullet" = 20, "laser" = 0, "energy" = 0, "bomb" = 60, "bio" = 100, "rad" = 100)
/obj/structure/window/plasmareinforced/New(Loc,re=0)
..()
@@ -499,6 +500,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
reinf = 1
basestate = "rwindow"
health = 40
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 25, "bio" = 100, "rad" = 100)
/obj/structure/window/reinforced/tinted
name = "tinted window"
+1 -1
View File
@@ -1,4 +1,4 @@
/obj/item/weapon
name = "weapon"
icon = 'icons/obj/weapons.dmi'
hitsound = "swing_hit"
hitsound = "swing_hit"