Skip to content

Commit

Permalink
adds ratvar_act() and adds ratvar_act()'s for a few things
Browse files Browse the repository at this point in the history
adds brass, clockwork floor, brass tables and table frames
  • Loading branch information
CryoSpacewalk committed Jan 18, 2018
1 parent 4e63e4c commit 900bfd5
Show file tree
Hide file tree
Showing 12 changed files with 168 additions and 17 deletions.
3 changes: 3 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,9 @@ var/list/blood_splatter_icons = list()
/atom/proc/narsie_act()
return

/atom/proc/ratvar_act()
return

/atom/proc/atom_say(message)
if(!message)
return
Expand Down
66 changes: 53 additions & 13 deletions code/game/objects/items/stacks/sheets/sheet_types.dm
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/* Diffrent misc types of sheets
/* Different misc types of sheets
* Contains:
* Metal
* Plasteel
* Wood
* Cloth
* Plastic
* Cardboard
* Runed Metal (cult)
* Metal
* Plasteel
* Wood
* Cloth
* Plastic
* Cardboard
* Runed Metal (cult)
* Brass (clockwork cult)
*/

/*
Expand Down Expand Up @@ -107,10 +108,13 @@ var/global/list/datum/stack_recipe/metal_recipes = list(
/obj/item/stack/sheet/metal/fifty
amount = 50

/obj/item/stack/sheet/metal/ratvar_act()
new /obj/item/stack/tile/brass(loc, amount)
qdel(src)

/obj/item/stack/sheet/metal/narsie_act()
if(prob(20))
new /obj/item/stack/sheet/runed_metal(loc, amount)
qdel(src)
new /obj/item/stack/sheet/runed_metal(loc, amount)
qdel(src)

/obj/item/stack/sheet/metal/New(var/loc, var/amount=null)
recipes = metal_recipes
Expand Down Expand Up @@ -273,12 +277,15 @@ var/global/list/datum/stack_recipe/cult = list ( \
/obj/item/stack/sheet/runed_metal
name = "runed metal"
desc = "Sheets of cold metal with shifting inscriptions writ upon them."
singular_name = "runed metal"
singular_name = "runed metal sheet"
icon_state = "sheet-runed"
icon = 'icons/obj/items.dmi'
sheettype = "runed"
merge_type = /obj/item/stack/sheet/runed_metal

/obj/item/stack/sheet/runed_metal/ratvar_act()
new /obj/item/stack/tile/brass(loc, amount)
qdel(src)

/obj/item/stack/sheet/runed_metal/attack_self(mob/living/user)
if(!iscultist(user))
to_chat(user, "<span class='warning'>Only one with forbidden knowledge could hope to work this metal...</span>")
Expand Down Expand Up @@ -306,6 +313,39 @@ var/global/list/datum/stack_recipe/cult = list ( \
recipes = cult
return ..()

/*
* Brass
*/
var/global/list/datum/stack_recipe/brass_recipes = list ( \
new/datum/stack_recipe("brass table frame", /obj/structure/table_frame/brass, 1, time = 5, one_per_turf = TRUE, on_floor = TRUE), \
)

/obj/item/stack/tile/brass
name = "brass"
desc = "Sheets made out of brass."
singular_name = "brass sheet"
icon_state = "sheet-brass"
icon = 'icons/obj/items.dmi'
burn_state = FIRE_PROOF
throwforce = 10
max_amount = 50
throw_speed = 1
throw_range = 3
turf_type = /turf/simulated/floor/clockwork

/obj/item/stack/tile/brass/narsie_act()
new /obj/item/stack/sheet/runed_metal(loc, amount)
qdel(src)

/obj/item/stack/tile/brass/New(loc, amount=null)
recipes = brass_recipes
. = ..()
pixel_x = 0
pixel_y = 0

/obj/item/stack/tile/brass/fifty
amount = 50

/*
* Bones
*/
Expand Down
31 changes: 31 additions & 0 deletions code/game/objects/structures/table_frames.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
new /obj/structure/table_frame/wood(loc)
qdel(src)

/obj/structure/table_frame/ratvar_act()
new /obj/structure/table_frame/brass(loc)
qdel(src)

/*
* Wooden Frames
*/
Expand Down Expand Up @@ -118,3 +122,30 @@
make_new_table(/obj/structure/table/wood/poker)
else
return ..()

/obj/structure/table_frame/brass
name = "brass table frame"
desc = "Four pieces of brass arranged in a square. It's slightly warm to the touch."
icon_state = "brass_frame"
burn_state = FIRE_PROOF
framestack = /obj/item/stack/tile/brass
framestackamount = 1

/obj/structure/table_frame/brass/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/stack/tile/brass))
var/obj/item/stack/tile/brass/W = I
if(W.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one brass sheet to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [W] to [src]...</span>")
if(do_after(user, 20, target = src) && W.use(1))
make_new_table(/obj/structure/table/reinforced/brass)
else
return ..()

/obj/structure/table_frame/brass/narsie_act()
..()
if(src) //do we still exist?
var/previouscolor = color
color = "#960000"
animate(src, color = previouscolor, time = 8)
35 changes: 31 additions & 4 deletions code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
new /obj/structure/table/wood(loc)
qdel(src)

/obj/structure/table/ratvar_act()
new /obj/structure/table/reinforced/brass(loc)
qdel(src)

/obj/structure/table/ex_act(severity)
switch(severity)
if(1)
Expand Down Expand Up @@ -477,8 +481,9 @@
burn_state = FLAMMABLE
burntime = 20

/obj/structure/table/wood/narsie_act()
return
/obj/structure/table/wood/narsie_act(total_override = TRUE)
if(!total_override)
..()

/obj/structure/table/wood/poker //No specialties, Just a mapping object.
name = "gambling table"
Expand All @@ -488,8 +493,7 @@
buildstack = /obj/item/stack/tile/carpet

/obj/structure/table/wood/poker/narsie_act()
new /obj/structure/table/wood(loc)
qdel(src)
..(FALSE)

/*
* Fancy Tables
Expand Down Expand Up @@ -565,6 +569,29 @@
else
. = ..()

/obj/structure/table/reinforced/brass
name = "brass table"
desc = "A solid, slightly beveled brass table."
icon = 'icons/obj/smooth_structures/brass_table.dmi'
icon_state = "brass_table"
burn_state = FIRE_PROOF
frame = /obj/structure/table_frame/brass
framestack = /obj/item/stack/tile/brass
buildstack = /obj/item/stack/tile/brass
framestackamount = 1
buildstackamount = 1
canSmoothWith = list(/obj/structure/table/reinforced/brass)

/obj/structure/table/reinforced/brass/narsie_act()
take_damage(rand(15, 45), BRUTE)
if(src) //do we still exist?
var/previouscolor = color
color = "#960000"
animate(src, color = previouscolor, time = 8)

/obj/structure/table/reinforced/brass/ratvar_act()
obj_integrity = max_integrity

/*
* Racks
*/
Expand Down
5 changes: 5 additions & 0 deletions code/game/turfs/simulated/floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,5 +223,10 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
if(prob(20))
ChangeTurf(/turf/simulated/floor/engine/cult)

/turf/simulated/floor/ratvar_act(force, ignore_mobs)
. = ..()
if(.)
ChangeTurf(/turf/simulated/floor/clockwork)

/turf/simulated/floor/can_have_cabling()
return !burnt && !broken
29 changes: 29 additions & 0 deletions code/game/turfs/simulated/floor/misc_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,32 @@

/turf/simulated/floor/noslip/MakeSlippery()
return

//Clockwork floor: Slowly heals toxin damage on nearby servants.
/turf/simulated/floor/clockwork
name = "clockwork floor"
desc = "Tightly-pressed brass tiles. They emit minute vibration."
icon_state = "clockwork_floor"

/turf/simulated/floor/clockwork/attackby(obj/item/I, mob/living/user, params)
if(iscrowbar(I))
user.visible_message("<span class='notice'>[user] begins slowly prying up [src]...</span>", "<span class='notice'>You begin painstakingly prying up [src]...</span>")
playsound(src, I.usesound, 20, 1)
if(!do_after(user, 70*I.toolspeed, target = src))
return 0
user.visible_message("<span class='notice'>[user] pries up [src]!</span>", "<span class='notice'>You pry up [src]!</span>")
playsound(src, I.usesound, 80, 1)
make_plating()
return 1
return ..()

/turf/simulated/floor/clockwork/make_plating()
new /obj/item/stack/tile/brass(src)
return ..()

/turf/simulated/floor/clockwork/narsie_act()
..()
if(istype(src, /turf/simulated/floor/clockwork)) //if we haven't changed type
var/previouscolor = color
color = "#960000"
animate(src, color = previouscolor, time = 8)
7 changes: 7 additions & 0 deletions code/game/turfs/simulated/floor/plating.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@
/turf/simulated/floor/engine/cult/narsie_act()
return

/turf/simulated/floor/engine/cult/ratvar_act()
. = ..()
if(istype(src, /turf/simulated/floor/engine/cult)) //if we haven't changed type
var/previouscolor = color
color = "#FAE48C"
animate(src, color = previouscolor, time = 8)

/turf/simulated/floor/engine/n20/New()
..()
var/datum/gas_mixture/adding = new
Expand Down
9 changes: 9 additions & 0 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,15 @@
/turf/proc/can_lay_cable()
return can_have_cabling() & !intact

/turf/ratvar_act(force, ignore_mobs, probability = 40)
. = (prob(probability) || force)
for(var/I in src)
var/atom/A = I
if(ignore_mobs && ismob(A))
continue
if(ismob(A) || .)
A.ratvar_act()

/turf/proc/add_blueprints(atom/movable/AM)
var/image/I = new
I.appearance = AM.appearance
Expand Down
Binary file modified icons/obj/items.dmi
Binary file not shown.
Binary file added icons/obj/smooth_structures/brass_table.dmi
Binary file not shown.
Binary file modified icons/obj/structures.dmi
Binary file not shown.
Binary file modified icons/turf/floors.dmi
Binary file not shown.

0 comments on commit 900bfd5

Please sign in to comment.