mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-05 15:11:38 +00:00
Adds the razorwire implant. Ready for review into merge (#23911)
* Please merge 23876 first thanks
* whoops / fix
* she snakes on my case till I
* Apply suggestions from code review
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
* deconflicts, ready for TM
* Update code/_onclick/click.dm
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
* lewcs good to them
* icon move and changes
* almost forgot to save this
* Update augments_arms.dm
* Inverted it, it seems.
* fixes lockers
* razorwire failsafes
* fuck
* razorwire one hand
* removes 2hand implant stuff
* Apply suggestions from code review
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
* s34ns changes
* Vampires can gain blood for a minute from people who succumb
* Revert "Vampires can gain blood for a minute from people who succumb"
This reverts commit 50a3cf87fe.
---------
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
@@ -129,9 +129,19 @@
|
||||
return
|
||||
|
||||
// operate three levels deep here (item in backpack in src; item in box in backpack in src, not any deeper)
|
||||
var/sdepth = A.storage_depth(src)
|
||||
if(A == loc || (A in loc) || (sdepth != -1 && sdepth <= 2))
|
||||
// No adjacency needed
|
||||
if(A in direct_access())
|
||||
if(W)
|
||||
W.melee_attack_chain(src, A, params)
|
||||
else
|
||||
if(ismob(A))
|
||||
changeNext_move(CLICK_CD_MELEE)
|
||||
UnarmedAttack(A, 1)
|
||||
return
|
||||
|
||||
if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that
|
||||
return TRUE
|
||||
|
||||
if(can_reach(A, W))
|
||||
if(W)
|
||||
W.melee_attack_chain(src, A, params)
|
||||
else
|
||||
@@ -139,30 +149,75 @@
|
||||
changeNext_move(CLICK_CD_MELEE)
|
||||
UnarmedAttack(A, 1)
|
||||
|
||||
return
|
||||
else
|
||||
if(W)
|
||||
W.afterattack(A, src, 0, params) // 0: not Adjacent
|
||||
else
|
||||
RangedAttack(A, params)
|
||||
|
||||
if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that
|
||||
return TRUE
|
||||
|
||||
// Allows you to click on a box's contents, if that box is on the ground, but no deeper than that
|
||||
sdepth = A.storage_depth_turf()
|
||||
if(isturf(A) || isturf(A.loc) || (sdepth != -1 && sdepth <= 1))
|
||||
if(A.Adjacent(src)) // see adjacent.dm
|
||||
if(W)
|
||||
W.melee_attack_chain(src, A, params)
|
||||
else
|
||||
if(ismob(A))
|
||||
changeNext_move(CLICK_CD_MELEE)
|
||||
UnarmedAttack(A, 1)
|
||||
/**
|
||||
* A backwards depth-limited breadth-first-search to see if the target is
|
||||
* logically "in" anything adjacent to us.
|
||||
*/
|
||||
/atom/movable/proc/can_reach(atom/ultimate_target, obj/item/tool, view_only = FALSE) //This might break mod storage. If it does, we hardcode mods / funny bag in here
|
||||
var/list/direct_access = direct_access()
|
||||
var/depth = 1 + (view_only ? STORAGE_VIEW_DEPTH : INVENTORY_DEPTH)
|
||||
|
||||
return
|
||||
else // non-adjacent click
|
||||
if(W)
|
||||
W.afterattack(A,src,0,params) // 0: not Adjacent
|
||||
else
|
||||
RangedAttack(A, params)
|
||||
var/list/closed = list()
|
||||
var/list/checking = list(ultimate_target)
|
||||
|
||||
return
|
||||
while(length(checking) && depth > 0)
|
||||
var/list/next = list()
|
||||
--depth
|
||||
|
||||
for(var/atom/target in checking) // will filter out nulls
|
||||
if(closed[target] || isarea(target)) // avoid infinity situations
|
||||
continue
|
||||
|
||||
if(isturf(target) || isturf(target.loc) || (target in direct_access) || !(target.IsObscured()) || istype(target.loc, /obj/item/storage)) //Directly accessible atoms
|
||||
if(target.Adjacent(src) || (tool && CheckToolReach(src, target, tool.reach))) //Adjacent or reaching attacks
|
||||
return TRUE
|
||||
|
||||
closed[target] = TRUE
|
||||
|
||||
if(!target.loc)
|
||||
continue
|
||||
|
||||
if(istype(target.loc, /obj/item/storage))
|
||||
next += target.loc
|
||||
|
||||
checking = next
|
||||
return FALSE
|
||||
|
||||
/atom/movable/proc/direct_access()
|
||||
return list(src, loc)
|
||||
|
||||
/mob/direct_access(atom/target)
|
||||
return ..() + contents
|
||||
|
||||
/mob/living/direct_access(atom/target)
|
||||
return ..() + get_contents()
|
||||
|
||||
/proc/CheckToolReach(atom/movable/here, atom/movable/there, reach)
|
||||
if(!here || !there)
|
||||
return FALSE
|
||||
switch(reach)
|
||||
if(0, 1)
|
||||
return FALSE //here.Adjacent(there)
|
||||
if(2 to INFINITY)
|
||||
var/obj/dummy = new(get_turf(here))
|
||||
dummy.pass_flags |= PASSTABLE
|
||||
dummy.invisibility = 120
|
||||
for(var/i in 1 to reach) //Limit it to that many tries
|
||||
var/turf/T = get_step(dummy, get_dir(dummy, there))
|
||||
if(dummy.can_reach(there))
|
||||
qdel(dummy)
|
||||
return TRUE
|
||||
if(!dummy.Move(T)) //we're blocked!
|
||||
qdel(dummy)
|
||||
return FALSE
|
||||
qdel(dummy)
|
||||
|
||||
/// Can this mob use keybinded click actions? (Altclick, Ctrlclick, ect)
|
||||
/mob/proc/can_use_clickbinds()
|
||||
|
||||
@@ -95,13 +95,10 @@
|
||||
return
|
||||
|
||||
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
|
||||
if(isturf(A) || isturf(A.loc))
|
||||
if(A.Adjacent(src)) // see adjacent.dm
|
||||
W.melee_attack_chain(src, A, params)
|
||||
return
|
||||
else
|
||||
W.afterattack(A, src, 0, params)
|
||||
return
|
||||
if(can_reach(A, W))
|
||||
W.melee_attack_chain(src, A, params)
|
||||
return
|
||||
W.afterattack(A, src, 0, params)
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/MiddleShiftControlClickOn(atom/A)
|
||||
|
||||
Reference in New Issue
Block a user