Files
Aurora.3/code/game/objects/effects/decals/contraband.dm
T
Alberyk 76b743a986 Adds the Aut'akh unathi (#5919)
* Base work for the unathi robot subspecies.

* Adds metabolism species, kidney vars, and the robot unathi organs.

* Moves some action buttons to organs, pretty much a bay port right now. Todo: the unathi and alien stuff should also go here.

* First autakh implant power.

* Fixes the organs action button this time.

* Finishes more implants, and interactions with flashs and vaurca.

* Prepare for great changes.

* Drops the real bomb, boss.

* He who fights with monsters.

* Far more work into augments and limb removing powers.

* Limb verbs should be good now.

* A LOT of work into the assited organ, allowing it to bleed and etc, as well adding a new chem that will stop bleeding in their case.

* Probably the last work on implants.

* Some extra touches.

* Some tweaks to the species.

* More fixes and adds kyre's sprites.

* More runtime fixes.

* Fixes the species name too.

* Fixes travis.

* Updates this file too to work with the new tools procs.

* Adds changelog

* Fixed changelog.

* Unathi hair and lore description.

* Some tweaks to this too.

* Locks away them for now, they will be released after we got all the events and etc done.

* Changes this chemical.

* Fixes an airlock runtime.

* Adds the non scan flag to the autakh, mostly due to some bizzare interactions with changelings and cloning.

* Organs removal changes; can't take out the organ if it is too damage.

* Restricts them back again.

* Robotic organs now have the proper icons and names.

* Adds sprites for their organs and some extra tweaks.

* Fixes this missing icon.

* emp should also now hurt assited organs.

* Tweaks more organ related things.

* Fixes the head not being properly set as well.

* Fixes their flags.

* fixes the flag for real this time.

* Poze's review.

* Changes the au'takh organ buttons to don't be animated.

* Helps with adminbus or something.

* Fowl's requested changes.

* Fixes a typo.

* Robotic limb's brute and burn mods are now controlled by the limb model.

* Fowl's changes once more.

* Stops some spam.

* More grammar.

* No eal.

* Skull's review.
2019-01-23 19:27:44 +01:00

168 lines
4.9 KiB
Plaintext

//########################## CONTRABAND ;3333333333333333333 -Agouri ###################################################
/obj/item/weapon/contraband
name = "contraband item"
desc = "You probably shouldn't be holding this."
icon = 'icons/obj/contraband.dmi'
force = 0
/obj/item/weapon/contraband/poster
name = "rolled-up poster"
desc = "The poster comes with its own automatic adhesive mechanism, for easy pinning to any vertical surface."
icon_state = "rolled_poster"
var/serial_number = 0
/obj/item/weapon/contraband/poster/Initialize(mapload, given_serial = 0)
. = ..()
if(given_serial == 0)
serial_number = rand(1, poster_designs.len)
else
serial_number = given_serial
name += " - No. [serial_number]"
//Places the poster on a wall
/obj/item/weapon/contraband/poster/afterattack(var/atom/A, var/mob/user, var/adjacent, var/clickparams)
if (!adjacent)
return
//must place on a wall and user must not be inside a closet/mecha/whatever
var/turf/W = A
if (!iswall(W) || !isturf(user.loc))
user << "<span class='warning'>You can't place this here!</span>"
return
var/placement_dir = get_dir(user, W)
if (!(placement_dir in cardinal))
user << "<span class='warning'>You must stand directly in front of the wall you wish to place that on.</span>"
return
//just check if there is a poster on or adjacent to the wall
var/stuff_on_wall = 0
if (locate(/obj/structure/sign/poster) in W)
stuff_on_wall = 1
//crude, but will cover most cases. We could do stuff like check pixel_x/y but it's not really worth it.
for (var/dir in cardinal)
var/turf/T = get_step(W, dir)
if (locate(/obj/structure/sign/poster) in T)
stuff_on_wall = 1
break
if (stuff_on_wall)
user << "<span class='notice'>There is already a poster there!</span>"
return
user << "<span class='notice'>You start placing the poster on the wall...</span>" //Looks like it's uncluttered enough. Place the poster.
var/obj/structure/sign/poster/P = new(user.loc, get_dir(user, W), serial_number)
flick("poster_being_set", P)
//playsound(W, 'sound/items/poster_being_created.ogg', 100, 1) //why the hell does placing a poster make printer sounds?
addtimer(CALLBACK(src, .proc/place_on_wall, P, user, W), 28, TIMER_CLIENT_TIME)
/obj/item/weapon/contraband/poster/proc/place_on_wall(obj/structure/sign/poster/P, mob/user, turf/W)
if (QDELETED(P))
return
if (iswall(W) && !QDELETED(user) && P.loc == user.loc)
user << "<span class='notice'>You place the poster!</span>"
else
P.roll_and_drop(P.loc)
qdel(src)
//############################## THE ACTUAL DECALS ###########################
/obj/structure/sign/poster
name = "poster"
desc = "A large piece of space-resistant printed paper. "
icon = 'icons/obj/contraband.dmi'
anchored = 1
var/serial_number //Will hold the value of src.loc if nobody initialises it
var/poster_type //So mappers can specify a desired poster
var/ruined = 0
/obj/structure/sign/poster/Initialize(mapload, placement_dir = null, serial = null)
. = ..()
if(!serial)
serial = rand(1, poster_designs.len) //use a random serial if none is given
serial_number = serial
var/datum/poster/design
if (poster_type)
var/path = text2path(poster_type)
design = new path
else
design = poster_designs[serial_number]
set_poster(design)
switch (placement_dir)
if (NORTH)
pixel_x = 0
pixel_y = 32
if (SOUTH)
pixel_x = 0
pixel_y = -32
if (EAST)
pixel_x = 32
pixel_y = 0
if (WEST)
pixel_x = -32
pixel_y = 0
/obj/structure/sign/poster/proc/set_poster(var/datum/poster/design)
name = "[initial(name)] - [design.name]"
desc = "[initial(desc)] [design.desc]"
icon_state = design.icon_state // poster[serial_number]
/obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(W.iswirecutter())
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
if(ruined)
user << "<span class='notice'>You remove the remnants of the poster.</span>"
qdel(src)
else
user << "<span class='notice'>You carefully remove the poster from the wall.</span>"
roll_and_drop(user.loc)
return
/obj/structure/sign/poster/attack_hand(mob/user as mob)
if(ruined)
return
if(alert("Do I want to rip the poster from the wall?","You think...","Yes","No") == "Yes")
if(ruined || !user.Adjacent(src))
return
visible_message("<span class='warning'>\The [user] rips \the [src] in a single, decisive motion!</span>" )
playsound(src.loc, 'sound/items/poster_ripped.ogg', 100, 1)
ruined = 1
icon_state = "poster_ripped"
name = "ripped poster"
desc = "You can't make out anything from the poster's original print. It's ruined."
add_fingerprint(user)
/obj/structure/sign/poster/proc/roll_and_drop(turf/newloc)
var/obj/item/weapon/contraband/poster/P = new(src, serial_number)
P.forceMove(newloc)
src.forceMove(P)
qdel(src)
/datum/poster
// Name suffix. Poster - [name]
var/name = ""
// Description suffix
var/desc = ""
var/icon_state = ""