Tribbles can be turned into fur products, you monster.

This commit is contained in:
ZomgPonies
2013-11-23 03:07:39 -05:00
parent e837130d9e
commit e9dec4df5c
10 changed files with 922 additions and 309 deletions
+277 -257
View File
@@ -1,26 +1,26 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
var/global/list/autolathe_recipes = list( \
/* screwdriver removed*/ \
new /obj/item/weapon/reagent_containers/glass/bucket(), \
new /obj/item/stack/sheet/metal(), \
new /obj/item/stack/sheet/glass(), \
new /obj/item/stack/sheet/rglass(), \
new /obj/item/stack/rods(), \
new /obj/item/stack/sheet/fur(), \
new /obj/item/weapon/crowbar(), \
new /obj/item/device/flashlight(), \
new /obj/item/weapon/extinguisher(), \
new /obj/item/device/multitool(), \
new /obj/item/device/t_scanner(), \
new /obj/item/weapon/weldingtool(), \
new /obj/item/weapon/screwdriver(), \
new /obj/item/weapon/weldingtool(), \
new /obj/item/weapon/wirecutters(), \
new /obj/item/weapon/wrench(), \
new /obj/item/device/multitool(), \
new /obj/item/device/analyzer(), \
new /obj/item/device/t_scanner(), \
new /obj/item/device/flashlight(), \
new /obj/item/weapon/extinguisher(), \
new /obj/item/clothing/head/welding(), \
new /obj/item/weapon/stock_parts/console_screen(), \
new /obj/item/weapon/airlock_electronics(), \
new /obj/item/weapon/airalarm_electronics(), \
new /obj/item/weapon/firealarm_electronics(), \
new /obj/item/stack/sheet/metal(), \
new /obj/item/stack/sheet/glass(), \
new /obj/item/stack/sheet/rglass(), \
new /obj/item/stack/rods(), \
new /obj/item/weapon/rcd_ammo(), \
new /obj/item/weapon/kitchenknife(), \
new /obj/item/weapon/scalpel(), \
@@ -28,8 +28,10 @@ var/global/list/autolathe_recipes = list( \
new /obj/item/weapon/surgicaldrill(),\
new /obj/item/weapon/retractor(),\
new /obj/item/weapon/cautery(),\
new /obj/item/weapon/hemostat(),\
new /obj/item/weapon/reagent_containers/glass/beaker(), \
new /obj/item/weapon/reagent_containers/glass/beaker/large(), \
new /obj/item/weapon/reagent_containers/glass/bucket(), \
new /obj/item/weapon/storage/box/blanks(), \
new /obj/item/ammo_casing/shotgun/beanbag(), \
new /obj/item/ammo_box/c38(), \
@@ -39,12 +41,17 @@ var/global/list/autolathe_recipes = list( \
new /obj/item/device/radio/headset(), \
new /obj/item/device/radio/off(), \
new /obj/item/device/assembly/infra(), \
new /obj/item/device/assembly/prox_sensor(), \
new /obj/item/device/assembly/timer(), \
new /obj/item/device/assembly/voice(), \
new /obj/item/weapon/light/tube(), \
new /obj/item/weapon/light/bulb(), \
new /obj/item/ashtray/glass(), \
new /obj/item/weapon/camera_assembly(), \
new /obj/item/clothing/ears/earmuffs/tribblemuffs(), \
new /obj/item/clothing/gloves/furgloves(), \
new /obj/item/clothing/head/furcap(), \
new /obj/item/clothing/shoes/furboots(), \
new /obj/item/clothing/suit/furcoat(), \
new /obj/item/clothing/suit/furcape(), \
)
var/global/list/autolathe_recipes_hidden = list( \
@@ -60,7 +67,7 @@ var/global/list/autolathe_recipes_hidden = list( \
)
/obj/machinery/autolathe
name = "\improper Autolathe"
name = "autolathe"
desc = "It produces items using metal and glass."
icon_state = "autolathe"
density = 1
@@ -71,6 +78,9 @@ var/global/list/autolathe_recipes_hidden = list( \
var/g_amount = 0.0
var/max_g_amount = 75000.0
var/f_amount = 0.0
var/max_f_amount = 50000.0
var/operating = 0.0
var/opened = 0.0
anchored = 1.0
@@ -88,278 +98,288 @@ var/global/list/autolathe_recipes_hidden = list( \
active_power_usage = 100
var/busy = 0
proc
wires_win(mob/user as mob)
var/dat as text
dat += "Autolathe Wires:<BR>"
for(var/wire in src.wires)
dat += text("[wire] Wire: <A href='?src=\ref[src];wire=[wire];act=wire'>[src.wires[wire] ? "Mend" : "Cut"]</A> <A href='?src=\ref[src];wire=[wire];act=pulse'>Pulse</A><BR>")
/obj/machinery/autolathe/proc/wires_win(mob/user as mob)
var/dat as text
dat += "Autolathe Wires:<BR>"
for(var/wire in src.wires)
dat += text("[wire] Wire: <A href='?src=\ref[src];wire=[wire];act=wire'>[src.wires[wire] ? "Mend" : "Cut"]</A> <A href='?src=\ref[src];wire=[wire];act=pulse'>Pulse</A><BR>")
dat += text("The red light is [src.disabled ? "off" : "on"].<BR>")
dat += text("The green light is [src.shocked ? "off" : "on"].<BR>")
dat += text("The blue light is [src.hacked ? "off" : "on"].<BR>")
user << browse("<HTML><HEAD><TITLE>Autolathe Hacking</TITLE></HEAD><BODY>[dat]</BODY></HTML>","window=autolathe_hack")
onclose(user, "autolathe_hack")
dat += text("The red light is [src.disabled ? "off" : "on"].<BR>")
dat += text("The green light is [src.shocked ? "off" : "on"].<BR>")
dat += text("The blue light is [src.hacked ? "off" : "on"].<BR>")
user << browse("<HTML><HEAD><TITLE>Autolathe Hacking</TITLE></HEAD><BODY>[dat]</BODY></HTML>","window=autolathe_hack")
onclose(user, "autolathe_hack")
regular_win(mob/user as mob)
var/dat as text
dat = text("<B>Metal Amount:</B> [src.m_amount] cm<sup>3</sup> (MAX: [max_m_amount])<BR>\n<FONT color=blue><B>Glass Amount:</B></FONT> [src.g_amount] cm<sup>3</sup> (MAX: [max_g_amount])<HR>")
var/list/objs = list()
objs += src.L
if (src.hacked)
objs += src.LL
for(var/obj/t in objs)
var/title = "[t.name] ([t.m_amt] m /[t.g_amt] g)"
if (m_amount<t.m_amt || g_amount<t.g_amt)
dat += title + "<br>"
continue
dat += "<A href='?src=\ref[src];make=\ref[t]'>[title]</A>"
if (istype(t, /obj/item/stack))
var/obj/item/stack/S = t
var/max_multiplier = min(S.max_amount, S.m_amt?round(m_amount/S.m_amt):INFINITY, S.g_amt?round(g_amount/S.g_amt):INFINITY)
if (max_multiplier>1)
dat += " |"
if (max_multiplier>10)
dat += " <A href='?src=\ref[src];make=\ref[t];multiplier=[10]'>x[10]</A>"
if (max_multiplier>25)
dat += " <A href='?src=\ref[src];make=\ref[t];multiplier=[25]'>x[25]</A>"
if (max_multiplier>1)
dat += " <A href='?src=\ref[src];make=\ref[t];multiplier=[max_multiplier]'>x[max_multiplier]</A>"
dat += "<br>"
user << browse("<HTML><HEAD><TITLE>Autolathe Control Panel</TITLE></HEAD><BODY><TT>[dat]</TT></BODY></HTML>", "window=autolathe_regular")
onclose(user, "autolathe_regular")
/obj/machinery/autolathe/proc/regular_win(mob/user as mob)
var/dat as text
dat = text("<B>Metal Amount:</B> [src.m_amount] cm<sup>3</sup> (MAX: [max_m_amount])<BR>\n<FONT color=blue><B>Glass Amount:</B></FONT> [src.g_amount] cm<sup>3</sup> (MAX: [max_g_amount])<BR>\n<FONT color=orange><B>Fur Amount:</B></FONT> [src.f_amount] cm<sup>3</sup> (MAX: [max_f_amount])<HR>")
var/list/objs = list()
objs += src.L
if (src.hacked)
objs += src.LL
for(var/obj/t in objs)
var/title = "[t.name] ([t.m_amt] m /[t.g_amt] g/[t.f_amt] f)"
if (m_amount<t.m_amt || g_amount<t.g_amt || f_amount<t.f_amt)
dat += title + "<br>"
continue
dat += "<A href='?src=\ref[src];make=\ref[t]'>[title]</A>"
if (istype(t, /obj/item/stack))
var/obj/item/stack/S = t
var/max_multiplier = min(S.max_amount, S.m_amt?round(m_amount/S.m_amt):INFINITY, S.g_amt?round(g_amount/S.g_amt):INFINITY, S.f_amt?round(f_amount/S.f_amt):INFINITY)
if (max_multiplier>1)
dat += " |"
if (max_multiplier>10)
dat += " <A href='?src=\ref[src];make=\ref[t];multiplier=[10]'>x[10]</A>"
if (max_multiplier>25)
dat += " <A href='?src=\ref[src];make=\ref[t];multiplier=[25]'>x[25]</A>"
if (max_multiplier>1)
dat += " <A href='?src=\ref[src];make=\ref[t];multiplier=[max_multiplier]'>x[max_multiplier]</A>"
dat += "<br>"
user << browse("<HTML><HEAD><TITLE>Autolathe Control Panel</TITLE></HEAD><BODY><TT>[dat]</TT></BODY></HTML>", "window=autolathe_regular")
onclose(user, "autolathe_regular")
shock(mob/user, prb)
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
return 0
if(!prob(prb))
return 0
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
if (electrocute_mob(user, get_area(src), src, 0.7))
return 1
else
return 0
/obj/machinery/autolathe/proc/shock(mob/user, prb)
if(stat & (BROKEN|NOPOWER)) // unpowered, no shock
return 0
if(!prob(prb))
return 0
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
if (electrocute_mob(user, get_area(src), src, 0.7))
return 1
else
return 0
interact(mob/user as mob)
if(..())
return
if (src.shocked)
src.shock(user,50)
if (src.opened)
wires_win(user,50)
return
if (src.disabled)
user << "\red You press the button, but nothing happens."
return
regular_win(user)
/obj/machinery/autolathe/interact(mob/user as mob)
if(..())
return
if (src.shocked)
src.shock(user,50)
if (src.opened)
wires_win(user,50)
return
if (src.disabled)
user << "\red You press the button, but nothing happens."
return
regular_win(user)
return
attackby(var/obj/item/O as obj, var/mob/user as mob)
if (stat)
/obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
if (stat)
return 1
if (busy)
user << "\red The autolathe is busy. Please wait for completion of previous operation."
return 1
if (istype(O, /obj/item/weapon/screwdriver))
if (!opened)
src.opened = 1
src.icon_state = "autolathe_t"
user << "You open the maintenance hatch of [src]."
else
src.opened = 0
src.icon_state = "autolathe"
user << "You close the maintenance hatch of [src]."
return 1
if (opened)
if(istype(O, /obj/item/weapon/crowbar))
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
M.state = 2
M.icon_state = "box_1"
for(var/obj/I in component_parts)
if(I.reliability != 100 && crit_fail)
I.crit_fail = 1
I.loc = src.loc
if(m_amount >= 3750)
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc)
G.amount = round(m_amount / 3750)
if(g_amount >= 3750)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
G.amount = round(g_amount / 3750)
del(src)
return 1
if (busy)
user << "\red The autolathe is busy. Please wait for completion of previous operation."
return 1
if (istype(O, /obj/item/weapon/screwdriver))
if (!opened)
src.opened = 1
src.icon_state = "autolathe_t"
user << "You open the maintenance hatch of [src]."
else
src.opened = 0
src.icon_state = "autolathe"
user << "You close the maintenance hatch of [src]."
return 1
if (opened)
if(istype(O, /obj/item/weapon/crowbar))
playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(src.loc)
M.state = 2
M.icon_state = "box_1"
for(var/obj/I in component_parts)
if(I.reliability != 100 && crit_fail)
I.crit_fail = 1
I.loc = src.loc
if(m_amount >= 3750)
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc)
G.amount = round(m_amount / 3750)
if(g_amount >= 3750)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
G.amount = round(g_amount / 3750)
del(src)
return 1
else
user.set_machine(src)
interact(user)
return 1
if(isrobot(user))
user << "\red You're a robot. No."
return 1
if (src.m_amount + O.m_amt > max_m_amount)
user << "\red The autolathe is full. Please remove metal from the autolathe in order to insert more."
return 1
if (src.g_amount + O.g_amt > max_g_amount)
user << "\red The autolathe is full. Please remove glass from the autolathe in order to insert more."
return 1
if (O.m_amt == 0 && O.g_amt == 0)
user << "\red This object does not contain significant amounts of metal or glass, or cannot be accepted by the autolathe due to size or hazardous materials."
else
user.set_machine(src)
interact(user)
return 1
if (src.m_amount + O.m_amt > max_m_amount)
user << "\red The autolathe is full. Please remove metal from the autolathe in order to insert more."
return 1
if (src.g_amount + O.g_amt > max_g_amount)
user << "\red The autolathe is full. Please remove glass from the autolathe in order to insert more."
return 1
if (src.f_amount + O.f_amt > max_f_amount)
user << "\red The autolathe is full. Please remove fur from the autolathe in order to insert more."
return 1
if (O.m_amt == 0 && O.g_amt == 0 && O.f_amt == 0)
user << "\red This object does not contain significant amounts of metal or glass, or cannot be accepted by the autolathe due to size or hazardous materials."
return 1
/*
if (istype(O, /obj/item/weapon/grab) && src.hacked)
var/obj/item/weapon/grab/G = O
if (prob(25) && G.affecting)
G.affecting.gib()
m_amount += 50000
return
if (istype(O, /obj/item/weapon/grab) && src.hacked)
var/obj/item/weapon/grab/G = O
if (prob(25) && G.affecting)
G.affecting.gib()
m_amount += 50000
f_amount += 1000
return
*/
var/amount = 1
var/obj/item/stack/stack
var/m_amt = O.m_amt
var/g_amt = O.g_amt
if (istype(O, /obj/item/stack))
stack = O
amount = stack.amount
if (m_amt)
amount = min(amount, round((max_m_amount-src.m_amount)/m_amt))
flick("autolathe_o",src)//plays metal insertion animation
if (g_amt)
amount = min(amount, round((max_g_amount-src.g_amount)/g_amt))
flick("autolathe_r",src)//plays glass insertion animation
stack.use(amount)
else
usr.before_take_item(O)
O.loc = src
icon_state = "autolathe"
busy = 1
use_power(max(1000, (m_amt+g_amt)*amount/10))
src.m_amount += m_amt * amount
src.g_amount += g_amt * amount
user << "You insert [amount] sheet[amount>1 ? "s" : ""] to the autolathe."
if (O && O.loc == src)
del(O)
busy = 0
src.updateUsrDialog()
var/amount = 1
var/obj/item/stack/stack
var/m_amt = O.m_amt
var/g_amt = O.g_amt
var/f_amt = O.f_amt
if (istype(O, /obj/item/stack))
stack = O
amount = stack.amount
if (m_amt)
amount = min(amount, round((max_m_amount-src.m_amount)/m_amt))
flick("autolathe_o",src)//plays metal insertion animation
if (g_amt)
amount = min(amount, round((max_g_amount-src.g_amount)/g_amt))
flick("autolathe_r",src)//plays glass insertion animation
if (f_amt)
amount = min(amount, round((max_f_amount-src.f_amount)/f_amt))
flick("autolathe_f",src)//plays fur insertion animation
stack.use(amount)
else
usr.before_take_item(O)
O.loc = src
icon_state = "autolathe"
busy = 1
use_power(max(1000, (m_amt+g_amt)*amount/10))
src.m_amount += m_amt * amount
src.g_amount += g_amt * amount
src.f_amount += f_amt * amount
user << "You insert [amount] sheet[amount>1 ? "s" : ""] to the autolathe."
if (O && O.loc == src)
del(O)
busy = 0
src.updateUsrDialog()
attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/autolathe/attack_paw(mob/user as mob)
return src.attack_hand(user)
attack_hand(mob/user as mob)
user.set_machine(src)
interact(user)
/obj/machinery/autolathe/attack_hand(mob/user as mob)
user.set_machine(src)
interact(user)
Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if (!busy)
if(href_list["make"])
var/turf/T = get_step(src.loc, get_dir(src,usr))
var/obj/template = locate(href_list["make"])
var/multiplier = text2num(href_list["multiplier"])
if (!multiplier) multiplier = 1
var/power = max(2000, (template.m_amt+template.g_amt)*multiplier/5)
if(src.m_amount >= template.m_amt*multiplier && src.g_amount >= template.g_amt*multiplier)
busy = 1
/obj/machinery/autolathe/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
src.add_fingerprint(usr)
if (!busy)
if(href_list["make"])
var/turf/T = get_step(src.loc, get_dir(src,usr))
var/obj/template = locate(href_list["make"])
var/multiplier = text2num(href_list["multiplier"])
if (!multiplier) multiplier = 1
var/power = max(2000, (template.m_amt+template.g_amt+template.f_amt)*multiplier/5)
if(src.m_amount >= template.m_amt*multiplier && src.g_amount >= template.g_amt*multiplier && src.f_amount >= template.f_amt*multiplier)
busy = 1
use_power(power)
icon_state = "autolathe"
flick("autolathe_n",src)
spawn(16)
use_power(power)
icon_state = "autolathe"
flick("autolathe_n",src)
spawn(16)
use_power(power)
spawn(16)
use_power(power)
spawn(16)
src.m_amount -= template.m_amt*multiplier
src.g_amount -= template.g_amt*multiplier
if(src.m_amount < 0)
src.m_amount = 0
if(src.g_amount < 0)
src.g_amount = 0
var/obj/new_item = new template.type(T)
if (multiplier>1)
var/obj/item/stack/S = new_item
S.amount = multiplier
busy = 0
src.updateUsrDialog()
if(href_list["act"])
var/temp_wire = href_list["wire"]
if(href_list["act"] == "pulse")
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
usr << "You need a multitool!"
src.m_amount -= template.m_amt*multiplier
src.g_amount -= template.g_amt*multiplier
src.f_amount -= template.f_amt*multiplier
if(src.m_amount < 0)
src.m_amount = 0
if(src.g_amount < 0)
src.g_amount = 0
if(src.f_amount < 0)
src.f_amount = 0
var/obj/new_item = new template.type(T)
if (multiplier>1)
var/obj/item/stack/S = new_item
S.amount = multiplier
busy = 0
src.updateUsrDialog()
if(href_list["act"])
var/temp_wire = href_list["wire"]
if(href_list["act"] == "pulse")
if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
usr << "You need a multitool!"
else
if(src.wires[temp_wire])
usr << "You can't pulse a cut wire."
else
if(src.wires[temp_wire])
usr << "You can't pulse a cut wire."
else
if(src.hack_wire == temp_wire)
src.hacked = !src.hacked
spawn(100) src.hacked = !src.hacked
if(src.disable_wire == temp_wire)
src.disabled = !src.disabled
src.shock(usr,50)
spawn(100) src.disabled = !src.disabled
if(src.shock_wire == temp_wire)
src.shocked = !src.shocked
src.shock(usr,50)
spawn(100) src.shocked = !src.shocked
if(href_list["act"] == "wire")
if (!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters))
usr << "You need wirecutters!"
else
wires[temp_wire] = !wires[temp_wire]
if(src.hack_wire == temp_wire)
src.hacked = !src.hacked
spawn(100) src.hacked = !src.hacked
if(src.disable_wire == temp_wire)
src.disabled = !src.disabled
src.shock(usr,50)
spawn(100) src.disabled = !src.disabled
if(src.shock_wire == temp_wire)
src.shocked = !src.shocked
src.shock(usr,50)
else
usr << "\red The autolathe is busy. Please wait for completion of previous operation."
src.updateUsrDialog()
return
spawn(100) src.shocked = !src.shocked
if(href_list["act"] == "wire")
if (!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters))
usr << "You need wirecutters!"
else
wires[temp_wire] = !wires[temp_wire]
if(src.hack_wire == temp_wire)
src.hacked = !src.hacked
if(src.disable_wire == temp_wire)
src.disabled = !src.disabled
src.shock(usr,50)
if(src.shock_wire == temp_wire)
src.shocked = !src.shocked
src.shock(usr,50)
else
usr << "\red The autolathe is busy. Please wait for completion of previous operation."
src.updateUsrDialog()
return
/obj/machinery/autolathe/RefreshParts()
..()
var/tot_rating = 0
for(var/obj/item/weapon/stock_parts/matter_bin/MB in component_parts)
tot_rating += MB.rating
tot_rating *= 25000
max_m_amount = tot_rating * 2
max_g_amount = tot_rating
max_f_amount = tot_rating
/obj/machinery/autolathe/New()
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/autolathe(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
RefreshParts()
..()
var/tot_rating = 0
for(var/obj/item/weapon/stock_parts/matter_bin/MB in component_parts)
tot_rating += MB.rating
tot_rating *= 25000
max_m_amount = tot_rating * 2
max_g_amount = tot_rating
New()
..()
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/autolathe(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(src)
component_parts += new /obj/item/weapon/stock_parts/manipulator(src)
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
RefreshParts()
src.L = autolathe_recipes
src.LL = autolathe_recipes_hidden
src.wires["Light Red"] = 0
src.wires["Dark Red"] = 0
src.wires["Blue"] = 0
src.wires["Green"] = 0
src.wires["Yellow"] = 0
src.wires["Black"] = 0
src.wires["White"] = 0
src.wires["Gray"] = 0
src.wires["Orange"] = 0
src.wires["Pink"] = 0
var/list/w = list("Light Red","Dark Red","Blue","Green","Yellow","Black","White","Gray","Orange","Pink")
src.hack_wire = pick(w)
w -= src.hack_wire
src.shock_wire = pick(w)
w -= src.shock_wire
src.disable_wire = pick(w)
w -= src.disable_wire
src.L = autolathe_recipes
src.LL = autolathe_recipes_hidden
src.wires["Light Red"] = 0
src.wires["Dark Red"] = 0
src.wires["Blue"] = 0
src.wires["Green"] = 0
src.wires["Yellow"] = 0
src.wires["Black"] = 0
src.wires["White"] = 0
src.wires["Gray"] = 0
src.wires["Orange"] = 0
src.wires["Pink"] = 0
var/list/w = list("Light Red","Dark Red","Blue","Green","Yellow","Black","White","Gray","Orange","Pink")
src.hack_wire = pick(w)
w -= src.hack_wire
src.shock_wire = pick(w)
w -= src.shock_wire
src.disable_wire = pick(w)
w -= src.disable_wire
+151 -51
View File
@@ -1,3 +1,6 @@
var/global/totaltribbles = 0 //global variable so it updates for all tribbles, not just the new one being made.
/mob/living/simple_animal/tribble
name = "tribble"
desc = "It's a small furry creature that makes a soft trill."
@@ -13,53 +16,27 @@
turns_per_move = 5
maxHealth = 10
health = 10
meat_type = /obj/item/stack/sheet/fur
response_help = "pets"
response_disarm = "gently pushes aside"
response_harm = "whacks"
harm_intent_damage = 5
var/gestation = 0
var/maxtribbles = 50
var/list/tribble_list = list()
var/maxtribbles = 50 //change this to change the max limit
wander = 1
/mob/living/simple_animal/tribble/New()
..()
var/list/types = list("tribble1","tribble2","tribble3")
src.icon_state = pick(types)
src.icon_living = src.icon_state
src.icon_dead = "[src.icon_state]_dead"
//random pixel offsets so they cover the floor
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
tribble_list += src
totaltribbles += 1
/obj/item/toy/tribble
name = "tribble"
desc = "It's a small furry creature that makes a soft trill."
icon = 'icons/mob/tribbles.dmi'
icon_state = "tribble1"
item_state = "tribble1"
var/gestation = 0
/obj/item/toy/tribble/attack_self(mob/user as mob)
..()
new /mob/living/simple_animal/tribble(user.loc)
for(var/mob/living/simple_animal/tribble/T in user.loc)
T.icon_state = src.icon_state
T.icon_living = src.icon_state
T.icon_dead = "[src.icon_state]_dead"
T.gestation = src.gestation
user << "<span class='notice'>You place the tribble on the floor.</span>"
del(src)
/obj/item/toy/tribble/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob)
..()
if(istype(O, /obj/item/weapon/scalpel) && src.gestation != null)
gestation = null
user << "<span class='notice'>You neuter the tribble so that it can no longer re-produce.</span>"
else if (istype(O, /obj/item/weapon/cautery) && src.gestation == null)
gestation = 0
user << "<span class='notice'>You fuse some recently cut tubes together, it should be able to reproduce again.</span>"
/mob/living/simple_animal/tribble/attack_hand(mob/user as mob)
..()
@@ -73,19 +50,17 @@
user.put_in_active_hand(T)
del(src)
/mob/living/simple_animal/tribble/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/scalpel))
gestation = null
user << "<span class='notice'>You try to neuter the tribble so that it can no longer re-produce, but it's moving too much, and you fail!</span>"
user << "<span class='notice'>You try to neuter the tribble, but it's moving too much and you fail!</span>"
else if(istype(O, /obj/item/weapon/cautery))
user << "<span class='notice'>You try to un-neuter the tribble, but it's moving too much and you fail!</span>"
..()
/mob/living/simple_animal/tribble/proc/procreate()
..()
var/totaltribbles = 0
for(var/mob/living/simple_animal/tribble/T in tribble_list)
if(T.stat == CONSCIOUS && T.health >= 1)
totaltribbles++
if(totaltribbles <= maxtribbles)
for(var/mob/living/simple_animal/tribble/F in src.loc)
if(!F || F == src)
@@ -95,8 +70,8 @@
/mob/living/simple_animal/tribble/Life()
..()
if(src.health > 0)
if(gestation != null)
if(src.health > 0) //no mostly dead procreation
if(gestation != null) //neuter check
if(gestation < 30)
gestation++
else if(gestation >= 30)
@@ -104,7 +79,50 @@
src.procreate()
/obj/structure/tribble
/mob/living/simple_animal/tribble/Die() // Gotta make sure to remove tribbles from the list on death
..()
totaltribbles -= 1
//||Item version of the trible ||
/obj/item/toy/tribble
name = "tribble"
desc = "It's a small furry creature that makes a soft trill."
icon = 'icons/mob/tribbles.dmi'
icon_state = "tribble1"
item_state = "tribble1"
w_class = 10.0
var/gestation = 0
/obj/item/toy/tribble/attack_self(mob/user as mob) //hug that tribble (and play a sound if we add one)
..()
user << "<span class='notice'>You nuzzle the tribble and it trills softly.</span>"
/obj/item/toy/tribble/dropped(mob/user as mob) //now you can't item form them to get rid of them all so easily
..()
new /mob/living/simple_animal/tribble(user.loc)
for(var/mob/living/simple_animal/tribble/T in user.loc)
T.icon_state = src.icon_state
T.icon_living = src.icon_state
T.icon_dead = "[src.icon_state]_dead"
T.gestation = src.gestation
user << "<span class='notice'>The tribble gets up and wanders around.</span>"
del(src)
/obj/item/toy/tribble/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob) //neutering and un-neutering
..()
if(istype(O, /obj/item/weapon/scalpel) && src.gestation != null)
gestation = null
user << "<span class='notice'>You neuter the tribble so that it can no longer re-produce.</span>"
else if (istype(O, /obj/item/weapon/cautery) && src.gestation == null)
gestation = 0
user << "<span class='notice'>You fuse some recently cut tubes together, it should be able to reproduce again.</span>"
//|| Tribble Cage - Lovingly lifted from the lamarr-cage ||
/obj/structure/tribble_cage
name = "Lab Cage"
icon = 'icons/mob/tribbles.dmi'
icon_state = "labcage1"
@@ -116,7 +134,7 @@
var/occupied = 1
var/destroyed = 0
/obj/structure/tribble/ex_act(severity)
/obj/structure/tribble_cage/ex_act(severity)
switch(severity)
if (1)
new /obj/item/weapon/shard( src.loc )
@@ -132,27 +150,27 @@
src.healthcheck()
/obj/structure/tribble/bullet_act(var/obj/item/projectile/Proj)
/obj/structure/tribble_cage/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
..()
src.healthcheck()
return
/obj/structure/tribble/blob_act()
/obj/structure/tribble_cage/blob_act()
if (prob(75))
new /obj/item/weapon/shard( src.loc )
Break()
del(src)
/obj/structure/tribble/meteorhit(obj/O as obj)
/obj/structure/tribble_cage/meteorhit(obj/O as obj)
new /obj/item/weapon/shard( src.loc )
Break()
del(src)
/obj/structure/tribble/proc/healthcheck()
/obj/structure/tribble_cage/proc/healthcheck()
if (src.health <= 0)
if (!( src.destroyed ))
src.density = 0
@@ -164,7 +182,7 @@
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
return
/obj/structure/tribble/update_icon()
/obj/structure/tribble_cage/update_icon()
if(src.destroyed)
src.icon_state = "labcageb[src.occupied]"
else
@@ -172,16 +190,16 @@
return
/obj/structure/tribble/attackby(obj/item/weapon/W as obj, mob/user as mob)
/obj/structure/tribble_cage/attackby(obj/item/weapon/W as obj, mob/user as mob)
src.health -= W.force
src.healthcheck()
..()
return
/obj/structure/tribble/attack_paw(mob/user as mob)
/obj/structure/tribble_cage/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/structure/tribble/attack_hand(mob/user as mob)
/obj/structure/tribble_cage/attack_hand(mob/user as mob)
if (src.destroyed)
return
else
@@ -193,9 +211,91 @@
healthcheck()
return
/obj/structure/tribble/proc/Break()
/obj/structure/tribble_cage/proc/Break()
if(occupied)
new /mob/living/simple_animal/tribble( src.loc )
occupied = 0
update_icon()
return
return
//||Fur and Fur Products ||
/obj
var/f_amt = 0 // registers fur amount as an object variable
/obj/item/stack/sheet/fur //basic fur sheets (very lumpy furry piles of sheets)
name = "pile of fur"
desc = "The by-product of tribbles."
singular_name = "fur piece"
icon = 'icons/mob/tribbles.dmi'
icon_state = "sheet-fur"
origin_tech = "materials=2"
f_amt = 1000
max_amount = 50
/obj/item/clothing/ears/earmuffs/tribblemuffs //earmuffs but with tribbles
name = "earmuffs"
desc = "Protects your hearing from loud noises, and quiet ones as well."
icon = 'icons/mob/tribbles.dmi'
icon_state = "tribblemuffs"
item_state = "tribblemuffs"
f_amt = 2000
/obj/item/clothing/gloves/furgloves
desc = "These gloves are warm and furry."
name = "fur gloves"
icon = 'icons/mob/tribbles.dmi'
icon_state = "furglovesico"
item_state = "furgloves"
f_amt = 3000
cold_protection = HANDS
min_cold_protection_temperature = GLOVES_MIN_COLD_PROTECITON_TEMPERATURE
/obj/item/clothing/head/furcap
name = "fur cap"
desc = "A warm furry cap."
icon = 'icons/mob/tribbles.dmi'
icon_state = "furcap"
item_state = "furcap"
f_amt = 5000
cold_protection = HEAD
min_cold_protection_temperature = HELMET_MIN_COLD_PROTECITON_TEMPERATURE
/obj/item/clothing/shoes/furboots
name = "fur boots"
desc = "Warm, furry boots."
icon = 'icons/mob/tribbles.dmi'
icon_state = "furboots"
item_state = "furboots"
f_amt = 4000
cold_protection = FEET
min_cold_protection_temperature = SHOE_MIN_COLD_PROTECITON_TEMPERATURE
/obj/item/clothing/suit/furcoat
name = "fur coat"
desc = "A trenchcoat made from fur. You could put an oxygen tank in one of the pockets."
icon = 'icons/mob/tribbles.dmi'
icon_state = "furcoat"
item_state = "furcoat"
blood_overlay_type = "armor"
f_amt = 15000
body_parts_covered = UPPER_TORSO|LEGS|ARMS|LOWER_TORSO
allowed = list (/obj/item/weapon/tank/emergency_oxygen)
cold_protection = UPPER_TORSO | LOWER_TORSO | LEGS | ARMS
min_cold_protection_temperature = SPACE_SUIT_MIN_COLD_PROTECITON_TEMPERATURE
/obj/item/clothing/suit/furcape
name = "fur cape"
desc = "A cape made from fur. You'll really be stylin' now."
icon = 'icons/mob/tribbles.dmi'
icon_state = "furcape"
item_state = "furcape"
blood_overlay_type = "armor"
f_amt = 10000
body_parts_covered = UPPER_TORSO|LEGS|ARMS
cold_protection = UPPER_TORSO | LEGS | ARMS
min_cold_protection_temperature = SPACE_SUIT_MIN_COLD_PROTECITON_TEMPERATURE