Merge pull request #7066 from tigercat2000/BumpRefactor

/tg/ Move refactor
This commit is contained in:
Fox McCloud
2017-05-25 17:36:01 -04:00
committed by GitHub
69 changed files with 1126 additions and 1191 deletions
+2 -2
View File
@@ -104,9 +104,9 @@
/obj/structure/alien/resin/hitby(atom/movable/AM)
..()
var/tforce = 0
if(!isobj(AM))
if(ismob(AM))
tforce = 10
else
else if(isobj(AM))
var/obj/O = AM
tforce = O.throwforce
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
@@ -67,7 +67,7 @@
/obj/item/clothing/gloves/color/black = 20,
/obj/item/clothing/head/hardhat = 10,
/obj/item/clothing/head/hardhat/red = 10,
/obj/item/clothing/head/that{throwforce = 1; throwing = 1} = 10,
/obj/item/clothing/head/that = 10,
/obj/item/clothing/head/ushanka = 10,
/obj/item/clothing/head/welding = 10,
/obj/item/clothing/mask/gas = 10,
+21 -34
View File
@@ -61,6 +61,8 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
var/block_chance = 0
var/hit_reaction_chance = 0 //If you want to have something unrelated to blocking/armour piercing etc. Maybe not needed, but trying to think ahead/allow more freedom
var/mob/thrownby = null
var/toolspeed = 1 // If this item is a tool, the speed multiplier
/* Species-specific sprites, concept stolen from Paradise//vg/.
@@ -217,7 +219,8 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
var/obj/item/weapon/storage/S = src.loc
S.remove_from_storage(src)
src.throwing = 0
if(throwing)
throwing.finalize(FALSE)
if(loc == user)
if(!user.unEquip(src))
return 0
@@ -231,36 +234,6 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
user.put_in_active_hand(src)
return 1
/obj/item/attack_alien(mob/user as mob)
if(isalien(user)) // -- TLE
var/mob/living/carbon/alien/A = user
if(!A.has_fine_manipulation)
if(src in A.contents) // To stop Aliens having items stuck in their pockets
A.unEquip(src)
to_chat(user, "Your claws aren't capable of such fine manipulation.")
return
if(istype(src.loc, /obj/item/weapon/storage))
for(var/mob/M in range(1, src.loc))
if(M.s_active == src.loc)
if(M.client)
M.client.screen -= src
src.throwing = 0
if(src.loc == user)
if(!user.unEquip(src))
return
else
if(istype(src.loc, /mob/living))
return
src.pickup(user)
user.put_in_active_hand(src)
return
/obj/item/attack_alien(mob/user as mob)
var/mob/living/carbon/alien/A = user
@@ -323,9 +296,6 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
/obj/item/proc/talk_into(mob/M, var/text, var/channel=null)
return
/obj/item/proc/moved(mob/user, old_loc)
return
/obj/item/proc/dropped(mob/user)
for(var/X in actions)
var/datum/action/A = X
@@ -546,6 +516,23 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
throw_at(S,14,3)
else ..()
/obj/item/throw_impact(atom/A)
if(A && !qdeleted(A))
var/itempush = 1
if(w_class < 4)
itempush = 0 // too light to push anything
return A.hitby(src, 0, itempush)
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
thrownby = thrower
callback = CALLBACK(src, .proc/after_throw, callback) //replace their callback with our own
. = ..(target, range, speed, thrower, spin, diagonals_first, callback)
/obj/item/proc/after_throw(datum/callback/callback)
if(callback) //call the original callback
. = callback.Invoke()
throw_speed = initial(throw_speed) //explosions change this.
/obj/item/proc/pwr_drain()
return 0 // Process Kill
+1 -1
View File
@@ -151,7 +151,7 @@ var/list/tape_roll_applications = list()
if(!density) return 1
if(height==0) return 1
if((mover.pass_flags & PASSTABLE || istype(mover, /obj/effect/meteor) || mover.throwing == 1) )
if((mover.pass_flags & PASSTABLE || istype(mover, /obj/effect/meteor) || mover.throwing))
return 1
else if(ismob(mover) && allowed(mover))
return 1
+1 -1
View File
@@ -115,7 +115,7 @@
last = C
break
/obj/item/weapon/twohanded/rcl/moved(mob/user, turf/old_loc, direct)
/obj/item/weapon/twohanded/rcl/on_mob_move(direct, mob/user)
if(active)
trigger(user)
+3 -3
View File
@@ -111,10 +111,10 @@
/obj/item/weapon/dice/attack_self(mob/user as mob)
diceroll(user)
/obj/item/weapon/dice/throw_at(atom/target, range, speed, mob/user as mob)
/obj/item/weapon/dice/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
if(!..())
return
diceroll(user)
diceroll(thrower)
/obj/item/weapon/dice/proc/diceroll(mob/user)
result = rand(1, sides)
@@ -133,7 +133,7 @@
user.visible_message("<span class='notice'>[user] has thrown [src]. It lands on [result]. [comment]</span>", \
"<span class='notice'>You throw [src]. It lands on [result]. [comment]</span>", \
"<span class='italics'>You hear [src] rolling, it sounds like a [fake_result].</span>")
else if(src.throwing == 0) //Dice was thrown and is coming to rest
else if(!throwing) //Dice was thrown and is coming to rest
visible_message("<span class='notice'>[src] rolls to a stop, landing on [result]. [comment]</span>")
/obj/item/weapon/dice/d20/e20/diceroll(mob/user as mob, thrown)
+4 -1
View File
@@ -316,4 +316,7 @@ a {
for(var/obj/item/Item in contents) //Empty out the contents
Item.forceMove(new_loc)
if(burn)
Item.fire_act() //Set them on fire, too
Item.fire_act() //Set them on fire, too
/obj/proc/on_mob_move(dir, mob/user)
return
@@ -56,7 +56,7 @@
if(throwing) // you keep some momentum when getting out of a thrown closet
step(AM, dir)
if(throwing)
throwing = 0
throwing.finalize(FALSE)
/obj/structure/closet/proc/open()
if(opened)
@@ -327,7 +327,7 @@
/obj/structure/closet/attack_hand(mob/user)
add_fingerprint(user)
toggle(user)
/obj/structure/closet/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
toggle(user)
+2 -2
View File
@@ -297,8 +297,8 @@
tforce = 5
else if(isobj(AM))
if(prob(50))
var/obj/item/I = AM
tforce = max(0, I.throwforce * 0.5)
var/obj/O = AM
tforce = max(0, O.throwforce * 0.5)
else if(anchored && !broken)
var/turf/T = get_turf(src)
var/obj/structure/cable/C = T.get_cable_node()
+2 -2
View File
@@ -190,7 +190,7 @@
layer = 2.0
var/obj/structure/morgue/connected = null
anchored = 1.0
throwpass = 1
pass_flags = LETPASSTHROW
/obj/structure/m_tray/attack_hand(mob/user as mob)
@@ -432,7 +432,7 @@
layer = 2.0
var/obj/structure/crematorium/connected = null
anchored = 1.0
throwpass = 1
pass_flags = LETPASSTHROW
/obj/structure/c_tray/attack_hand(mob/user as mob)
if(connected)
+8 -3
View File
@@ -18,7 +18,7 @@
density = 1
anchored = 1.0
layer = 2.8
throwpass = 1 //You can throw objects over this, despite it's density.")
pass_flags = LETPASSTHROW
climbable = 1
var/parts = /obj/item/weapon/table_parts
@@ -127,7 +127,8 @@
return
/obj/structure/table/CanPass(atom/movable/mover, turf/target, height=0)
if(height==0) return 1
if(height == 0)
return 1
if(istype(mover,/obj/item/projectile))
return (check_cover(mover,target))
if(ismob(mover))
@@ -136,6 +137,8 @@
return 1
if(istype(mover) && mover.checkpass(PASSTABLE))
return 1
if(mover.throwing)
return 1
if(locate(/obj/structure/table) in get_turf(mover))
return 1
if(flipped)
@@ -526,7 +529,7 @@
icon_state = "rack"
density = 1
anchored = 1.0
throwpass = 1 //You can throw objects over this, despite it's density.
pass_flags = LETPASSTHROW
var/parts = /obj/item/weapon/rack_parts
var/health = 5
@@ -563,6 +566,8 @@
return 1
if(istype(mover) && mover.checkpass(PASSTABLE))
return 1
if(mover.throwing)
return 1
else
return 0
+18 -16
View File
@@ -108,22 +108,24 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
return 1
/obj/structure/window/hitby(atom/movable/AM)
if(!CanPass(AM, get_step(src, AM.dir))) //So thrown objects that cross a tile with non-full windows will no longer hit the window even if it isn't visually obstructing the path.
..()
var/tforce = 0
if(isobj(AM))
var/obj/item/I = AM
tforce = I.throwforce
if(reinf) tforce *= 0.25
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
health = max(0, health - tforce)
if(health <= 7 && !reinf)
anchored = 0
update_nearby_icons()
step(src, get_dir(AM, src))
if(health <= 0)
destroy()
/obj/structure/window/hitby(atom/movable/AM)
..()
var/tforce = 0
if(ismob(AM))
tforce = 10
else if(isobj(AM))
var/obj/O = AM
tforce = O.throwforce
if(reinf)
tforce *= 0.25
playsound(loc, 'sound/effects/Glasshit.ogg', 100, 1)
health = max(0, health - tforce)
if(health <= 7 && !reinf)
anchored = 0
update_nearby_icons()
step(src, get_dir(AM, src))
if(health <= 0)
destroy()
/obj/structure/window/attack_hand(mob/user as mob)
-5
View File
@@ -2,8 +2,3 @@
name = "weapon"
icon = 'icons/obj/weapons.dmi'
hitsound = "swing_hit"
/obj/item/weapon/Bump(mob/M as mob)
spawn(0)
..()
return