TG: - Removed support for the ONBACK and ONBELT flags.

- Replaced them with a whole range of inventory slot flags. These now govern
whether an item can or can't be placed in a certain inventory slot. See setup.dm
for information on the flags. These flags only affect humans tho, as humans are
the only beings with an inventory to talk of.
- Standardized some gun code and some other pieces of code as I came accross
them. I hate indented variable definitions!

This commit should not bring any change whatsoever to the game from a player's
perspective.
Revision: r3659
Author: 	 baloh.matevz
This commit is contained in:
Erthilo
2012-05-28 22:58:57 +01:00
parent 9b5d6f6ec3
commit a7dd312b3e
69 changed files with 863 additions and 914 deletions
+4 -4
View File
@@ -7,9 +7,8 @@
icon_state = "candle1"
item_state = "candle1"
var
wax = 200
lit = 0
var/wax = 200
var/lit = 0
proc
light(var/flavor_text = "\red [usr] lights the [name].")
@@ -94,7 +93,8 @@
w_class = 1
throwforce = 2
var/candlecount = 5
flags = ONBELT | TABLEPASS
flags = TABLEPASS
slot_flags = SLOT_BELT
/obj/item/weapon/candlepack/update_icon()
+2 -1
View File
@@ -3,7 +3,8 @@
icon = 'robot_parts.dmi'
item_state = "buildpipe"
icon_state = "blank"
flags = FPRINT | ONBELT | TABLEPASS | CONDUCT
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
var/construction_time = 100
var/list/construction_cost = list("metal"=20000,"glass"=5000)
+4 -1
View File
@@ -58,7 +58,8 @@
desc = "A heavy-duty, no fun allowed trash bag."
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
var/capacity = 25; //the number of trash it can carry.
flags = FPRINT | TABLEPASS | ONBELT
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
w_class = 2.0
/obj/item/weapon/trashbag/update_icon()
@@ -88,6 +89,7 @@
if(contents.len < capacity) //slightly redundant, but it makes it prettier in the chatbox. -Pete
user << "\blue You pick up all the trash."
for(var/obj/item/O in get_turf(W))
if(istype(O, /obj/item/weapon/disk/nuclear)) continue //No nuke disks - Nodrak
if(contents.len < capacity)
if(O.w_class <= 2)
contents += O;
@@ -97,6 +99,7 @@
else
user << "\blue The bag is full!"
else
if(istype(W, /obj/item/weapon/disk/nuclear)) return //No nuke disks - Nodrak
if(contents.len < capacity)
contents += W;
else
@@ -63,7 +63,8 @@ ZIPPO
icon_state = "matchbox"
item_state = "zippo"
w_class = 1
flags = ONBELT | TABLEPASS
flags = TABLEPASS
slot_flags = SLOT_BELT
var/matchcount = 10
w_class = 1.0
@@ -113,14 +114,14 @@ ZIPPO
item_state = "cigoff"
w_class = 1
body_parts_covered = null
var
lit = 0
icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
icon_off = "cigoff"
icon_butt = "cigbutt"
lastHolder = null
smoketime = 300
butt_count = 5 //count of butt sprite variations
var/lit = 0
var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
var/icon_off = "cigoff"
var/icon_butt = "cigbutt"
var/lastHolder = null
var/smoketime = 300
var/butt_count = 5 //count of butt sprite variations
proc
light(var/flavor_text = "[usr] lights the [name].")
@@ -161,7 +162,6 @@ ZIPPO
processing_objects.Add(src)
process()
var/turf/location = get_turf(src)
src.smoketime--
@@ -244,13 +244,13 @@ ZIPPO
item_state = "cobpipeoff"
w_class = 1
body_parts_covered = null
var
lit = 0
icon_on = "cobpipeon" //Note - these are in masks.dmi
icon_off = "cobpipeoff"
lastHolder = null
smoketime = 100
maxsmoketime = 100 //make sure this is equal to your smoketime
var/lit = 0
var/icon_on = "cobpipeon" //Note - these are in masks.dmi
var/icon_off = "cobpipeoff"
var/lastHolder = null
var/smoketime = 100
var/maxsmoketime = 100 //make sure this is equal to your smoketime
proc
light(var/flavor_text = "[usr] lights the [name].")
@@ -337,9 +337,9 @@ ZIPPO
item_state = "cigpacket"
w_class = 1
throwforce = 2
flags = ONBELT | TABLEPASS
var
cigcount = 6
flags = TABLEPASS
slot_flags = SLOT_BELT
var/cigcount = 6
update_icon()
@@ -382,7 +382,8 @@ ZIPPO
var/icon_off = "lighter-g"
w_class = 1
throwforce = 4
flags = ONBELT | TABLEPASS | CONDUCT
flags = TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
var/lit = 0
/obj/item/weapon/lighter/zippo
@@ -410,16 +411,16 @@ ZIPPO
src.item_state = icon_on
if( istype(src,/obj/item/weapon/lighter/zippo) )
for(var/mob/O in viewers(user, null))
O.show_message(text("\red Without even breaking stride, [] flips open and lights [] in one smooth movement.", user, src), 1)
O.show_message(text("\red Without even breaking stride, \the [] flips open and lights \the [] in one smooth movement.", user, src), 1)
else
if(prob(75))
for(var/mob/O in viewers(user, null))
O.show_message("\red After a few attempts, [user] manages to light [src].", 1)
O.show_message("\red After a few attempts, \the [user] manages to light \the [src].", 1)
else
user << "\red <b>You burn yourself while lighting the lighter.</b>"
user.adjustFireLoss(5)
for(var/mob/O in viewers(user, null))
O.show_message("\red After a few attempts, [user] manages to light [src], they however burn their finger in the process.", 1)
O.show_message("\red After a few attempts, \the [user] manages to light \the [src], they however burn themself in the process.", 1)
user.total_luminosity += 2
processing_objects.Add(src)
@@ -472,4 +473,4 @@ ZIPPO
if(lit)
user.total_luminosity -= 2
src.sd_SetLuminosity(2)
return
return
+22 -17
View File
@@ -14,15 +14,17 @@ FLASHBANG
item_state = "emp"
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
origin_tech = "materials=2;magnets=3"
var
active = 0
det_time = 50
proc
prime()
clown_check(var/mob/living/user)
var/active = 0
var/det_time = 50
proc/prime()
return
proc/clown_check(var/mob/living/user)
return
afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container
@@ -88,17 +90,21 @@ FLASHBANG
item_state = "flashbang"
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
origin_tech = "materials=2;combat=1"
var
active = 0
det_time = 30
banglet = 0
proc
bang(var/turf/T , var/mob/living/carbon/M)
prime()
clown_check(var/mob/living/user)
var/active = 0
var/det_time = 30
var/banglet = 0
proc/bang(var/turf/T , var/mob/living/carbon/M)
return
proc/prime()
return
proc/clown_check(var/mob/living/user)
return
attackby(obj/item/weapon/W as obj, mob/user as mob)
if (isscrewdriver(W))
@@ -227,7 +233,6 @@ FLASHBANG
M << "\red Your ears start to ring!"
prime() // Prime now just handles the two loops that query for people in lockers and people who can see it.
var/turf/T = get_turf(src)
if(T)
T.hotspot_expose(700,125)
@@ -4,7 +4,8 @@
name = "space cleaner"
icon_state = "cleaner"
item_state = "cleaner"
flags = ONBELT|TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
flags = TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
slot_flags = SLOT_BELT
throwforce = 3
w_class = 2.0
throw_speed = 2
@@ -115,7 +116,8 @@
name = "chem sprayer"
icon_state = "chemsprayer"
item_state = "chemsprayer"
flags = ONBELT|TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
flags = TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
slot_flags = SLOT_BELT
throwforce = 3
w_class = 3.0
throw_speed = 2
@@ -210,7 +212,6 @@
return
return
//Pepper spray, set up to make the 2 different types
/obj/item/weapon/pepperspray //This is riot control
@@ -219,7 +220,8 @@
name = "pepperspray"
icon_state = "pepperspray"
item_state = "pepperspray"
flags = ONBELT|TABLEPASS|FPRINT|USEDELAY
flags = TABLEPASS | FPRINT | USEDELAY
slot_flags = SLOT_BELT
throwforce = 3
w_class = 2.0
throw_speed = 2
@@ -234,7 +236,8 @@
name = "mace"
icon_state = "pepperspray"
item_state = "pepperspray"
flags = ONBELT|TABLEPASS|FPRINT|USEDELAY
flags = TABLEPASS | FPRINT | USEDELAY
slot_flags = SLOT_BELT
throwforce = 3
w_class = 1.0
throw_speed = 2
@@ -451,13 +454,12 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
/proc/GetColors(hex)
hex = uppertext(hex)
var
hi1 = text2ascii(hex, 2)
lo1 = text2ascii(hex, 3)
hi2 = text2ascii(hex, 4)
lo2 = text2ascii(hex, 5)
hi3 = text2ascii(hex, 6)
lo3 = text2ascii(hex, 7)
var/hi1 = text2ascii(hex, 2)
var/lo1 = text2ascii(hex, 3)
var/hi2 = text2ascii(hex, 4)
var/lo2 = text2ascii(hex, 5)
var/hi3 = text2ascii(hex, 6)
var/lo3 = text2ascii(hex, 7)
return list(((hi1>= 65 ? hi1-55 : hi1-48)<<4) | (lo1 >= 65 ? lo1-55 : lo1-48),
((hi2 >= 65 ? hi2-55 : hi2-48)<<4) | (lo2 >= 65 ? lo2-55 : lo2-48),
((hi3 >= 65 ? hi3-55 : hi3-48)<<4) | (lo3 >= 65 ? lo3-55 : lo3-48))
+2 -1
View File
@@ -7,7 +7,8 @@
name = "Plant Bag"
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
var/capacity = 50; //the number of plant pieces it can carry.
flags = FPRINT | TABLEPASS | ONBELT
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
w_class = 1
/obj/item/weapon/plantbag/attack_self(mob/user as mob)
+9 -8
View File
@@ -13,7 +13,8 @@ WELDINGTOOOL
desc = "A wrench with common uses. Can be found in your hand."
icon = 'items.dmi'
icon_state = "wrench"
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
flags = FPRINT | TABLEPASS| CONDUCT
slot_flags = SLOT_BELT
force = 5.0
throwforce = 7.0
w_class = 2.0
@@ -44,7 +45,8 @@ WELDINGTOOOL
name = "Welding Tool"
icon = 'items.dmi'
icon_state = "welder"
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
flags = FPRINT | TABLEPASS| CONDUCT
slot_flags = SLOT_BELT
force = 3.0
throwforce = 5.0
throw_speed = 1
@@ -53,10 +55,9 @@ WELDINGTOOOL
m_amt = 70
g_amt = 30
origin_tech = "engineering=1"
var
welding = 0
status = 1
max_fuel = 20
var/welding = 0
var/status = 1
var/max_fuel = 20
proc
get_fuel()
remove_fuel(var/amount = 1, var/mob/M = null)
@@ -224,7 +225,6 @@ WELDINGTOOOL
src.damtype = "brute"
src.icon_state = "welder"
src.welding = 0
return
eyecheck(mob/user as mob)
@@ -313,7 +313,8 @@ WELDINGTOOOL
desc = "This cuts wires."
icon = 'items.dmi'
icon_state = "cutters"
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
flags = FPRINT | TABLEPASS| CONDUCT
slot_flags = SLOT_BELT
force = 6.0
throw_speed = 2
throw_range = 9
+1 -1
View File
@@ -93,7 +93,7 @@
desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?"
force = 5
w_class = 4.0
flags = ONBACK
slot_flags = SLOT_BACK
force_unwielded = 5
force_wielded = 18