Runtime fixes for:

runtime error: Cannot modify null.layer. proc name: done (/obj/effect/equip_e/human/done) usr: Ramona Fawkes (/mob/living/carbon/human) src: the human (/obj/effect/equip_e/human)
call stack: the human (/obj/effect/equip_e/human): done() the human (/obj/effect/equip_e/human): process()

runtime error: Cannot execute null.use(). proc name: attackby (/obj/structure/barricade/wooden/attackby) usr: Jeffery Long (/mob/living/carbon/human) src: the wooden barricade (/obj/structure/barricade/wooden) call stack: the wooden barricade (/obj/structure/barricade/wooden): attackby(null, Jeffery Long (/mob/living/carbon/human)) the wooden barricade (/obj/structure/barricade/wooden): DblClick(the floor (159,129,1) (/turf/simulated/floor), "mapwindow.map", "icon-x=15;icon-y=12;left=1;scr...")

Rewrote wielded weapons to be their own weapon subclass. There was no point having a var/wielded var/twohanded var/force_unwielded var/force_wielded for every damn item when there is only 1 wield-able weapon anyway. All the wield-able stuff is now in twohanded.dm

Changed the adminhelpsound to some creative commons sound I pinched. Until somebody can get a better one. I'm sick of MAAAAAAAAOOOOOOW.

All PMs trigger the adminhelp sound. That means when you OM a player they get the sound, if a admin is PMed they only hear it if their adminhelp sounds are enabled. This should allow people to get eachother's attention when t he chat is busy.

Fixed some bad code with poddoors (which is used for the shutters in QM)

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3435 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-04-11 05:01:44 +00:00
parent cbad29832e
commit d775e1ac80
23 changed files with 272 additions and 288 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
/obj/structure/closet/fireaxecabinet
name = "Fire Axe Cabinet"
desc = "There is small label that reads \"For Emergency use only\" along with details for safe use of the axe. As if."
var/obj/item/weapon/fireaxe/fireaxe = new/obj/item/weapon/fireaxe
var/obj/item/weapon/twohanded/fireaxe/fireaxe = new/obj/item/weapon/twohanded/fireaxe
icon_state = "fireaxe1000"
icon_closed = "fireaxe1000"
icon_opened = "fireaxe1100"
@@ -51,9 +51,9 @@
src.localopened = 1
update_icon()
return
if (istype(O, /obj/item/weapon/fireaxe) && src.localopened)
if (istype(O, /obj/item/weapon/twohanded/fireaxe) && src.localopened)
if(!fireaxe)
if(O.wielded)
if(O:wielded)
user << "\red Unwield the axe first."
return
fireaxe = O
-47
View File
@@ -11,20 +11,6 @@
/obj/item/proc/dropped(mob/user as mob)
..()
// So you can't drop the Offhand
if(istype(src, /obj/item/weapon/offhand))
user.drop_item(src)
var/obj/item/O_r = user.r_hand
var/obj/item/O_l = user.l_hand
if(O_r.twohanded)
if(O_r.wielded)
user.drop_item(O_r)
if(O_l.twohanded)
if(O_l.wielded)
user.drop_item(O_l)
del(src)
// called just as an item is picked up (loc is not yet changed)
/obj/item/proc/pickup(mob/user)
return
@@ -185,39 +171,6 @@
/obj/item/attackby(obj/item/weapon/W as obj, mob/user as mob)
return
/obj/item/attack_self(mob/user as mob)
..()
if(twohanded)
if(wielded) //Trying to unwield it
wielded = 0
force = force_unwielded
src.name = "[initial(name)] (Unwielded)"
src.update_icon() //If needed by the particular item
user << "\blue You are now carrying the [initial(name)] with one hand."
if(istype(user.get_inactive_hand(),/obj/item/weapon/offhand))
del user.get_inactive_hand()
return
else //Trying to wield it
if(user.get_inactive_hand())
user << "\red You need your other hand to be empty"
return
wielded = 1
force = force_wielded
src.name = "[initial(name)] (Wielded)"
src.update_icon() //If needed by the particular item
user << "\blue You grab the [initial(name)] with both hands."
var/obj/item/weapon/offhand/O = new /obj/item/weapon/offhand(user) ////Let's reserve his other hand~
O.name = text("[initial(src.name)] - Offhand")
O.desc = "Your second grip on the [initial(src.name)]"
if(user.hand)
user.r_hand = O ///Place dat offhand in the opposite hand
else
user.l_hand = O
O.layer = 20
return
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (!istype(M)) // not sure if this is the right thing...
@@ -147,7 +147,7 @@ Craftables (Cob pipes, potato batteries, pumpkinheads)
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/fireaxe) || istype(W, /obj/item/weapon/fireaxe) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/melee/energy))
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/twohanded/fireaxe) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/melee/energy))
user.show_message("<span class='notice'>You carve a face into the [src]!</span>", 1)
new /obj/item/clothing/head/helmet/hardhat/pumpkinhead (user.loc)
del(src)
+101 -13
View File
@@ -2,27 +2,115 @@
##################### TWO HANDED WEAPONS BE HERE~ -Agouri :3 ########
####################################################################*/
///General Offhand object properties///
//Rewrote TwoHanded weapons stuff and put it all here. Just copypasta fireaxe to make new ones ~Carn
//This rewrite means we don't have two variables for EVERY item which are used only by a few weapons.
//It also tidies stuff up elsewhere.
////////////FIREAXE!//////////////
/obj/item/weapon/twohanded
var/wielded = 0
var/force_unwielded = 0
var/force_wielded = 0
/obj/item/weapon/twohanded/proc/unwield()
wielded = 0
force = force_unwielded
name = "[initial(name)]"
update_icon()
/obj/item/weapon/fireaxe/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = text("fireaxe[]",wielded)
/obj/item/weapon/twohanded/proc/wield()
wielded = 1
force = force_wielded
name = "[initial(name)] (Wielded)"
update_icon()
/obj/item/weapon/twohanded/dropped(mob/user as mob)
//handles unwielding a twohanded weapon when dropped as well as clearing up the offhand
//bit of a hack but it keeps other code pretty neat and with fewer conditionals
var/obj/item/weapon/twohanded/O
if(user)
if(user.l_hand)
O = user.l_hand
else
O = user.r_hand
if(O && istype(O))
O.unwield()
return unwield()
/obj/item/weapon/twohanded/update_icon()
return
/obj/item/weapon/fireaxe/pickup(mob/user)
wielded = 0
name = "Fire Axe (Unwielded)"
/obj/item/weapon/twohanded/pickup(mob/user)
unwield()
/obj/item/weapon/fireaxe/attack_self(mob/user as mob)
/obj/item/weapon/twohanded/attack_self(mob/user as mob)
if( istype(user,/mob/living/carbon/monkey) )
user << "\red It's too heavy for you to fully wield"
user << "<span class='warning'>It's too heavy for you to wield fully.</span>"
return
//welp, all is good, now to see if he's trying do twohandedly wield it or unwield it
..()
if(wielded) //Trying to unwield it
unwield()
user << "<span class='notice'>You are now carrying the [name] with one hand.</span>"
/obj/item/weapon/offhand/dropped(mob/user as mob)
del(src)
var/obj/item/weapon/twohanded/offhand/O = user.get_inactive_hand()
if(O && istype(O))
O.unwield()
return
else //Trying to wield it
if(user.get_inactive_hand())
user << "<span class='warning'>You need your other hand to be empty</span>"
return
wield()
user << "<span class='notice'>You grab the [initial(name)] with both hands.</span>"
var/obj/item/weapon/twohanded/offhand/O = new(user) ////Let's reserve his other hand~
O.name = "[initial(name)] - offhand"
O.desc = "Your second grip on the [initial(name)]"
if(user.hand)
user.r_hand = O ///Place dat offhand in the opposite hand
else
user.l_hand = O
O.layer = 20
return
///////////OFFHAND///////////////
/obj/item/weapon/twohanded/offhand
w_class = 5.0
icon_state = "offhand"
name = "offhand"
unwield()
del(src)
wield()
del(src)
////////////FIREAXE!//////////////
/obj/item/weapon/twohanded/fireaxe // DEM AXES MAN, marker -Agouri
icon_state = "fireaxe0"
name = "fire axe"
desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?"
force = 5
w_class = 4.0
flags = ONBACK
force_unwielded = 5
force_wielded = 18
/obj/item/weapon/twohanded/fireaxe/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "fireaxe[wielded]"
return
/obj/item/weapon/twohanded/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
..()
if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
var/obj/structure/window/W = A
new /obj/item/weapon/shard( W.loc )
if(W.reinf) new /obj/item/stack/rods( W.loc)
if (W.dir == SOUTHWEST)
new /obj/item/weapon/shard( W.loc )
if(W.reinf) new /obj/item/stack/rods( W.loc)
del(A)
-14
View File
@@ -203,17 +203,3 @@
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>The mousetrap is triggered by [A].</B>"), 1)
src.triggered(null)
/obj/item/weapon/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
..()
if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
var/obj/structure/window/W = A
new /obj/item/weapon/shard( W.loc )
if(W.reinf) new /obj/item/stack/rods( W.loc)
if (W.dir == SOUTHWEST)
new /obj/item/weapon/shard( W.loc )
if(W.reinf) new /obj/item/stack/rods( W.loc)
del(A)