diff --git a/code/defines/procs/gamehelpers.dm b/code/defines/procs/gamehelpers.dm index 862d09e09ef..10e1dc7adbd 100644 --- a/code/defines/procs/gamehelpers.dm +++ b/code/defines/procs/gamehelpers.dm @@ -33,14 +33,25 @@ return 0 //not in range and not telekinetic -/proc/circledistance(center=usr, T) // T is just the second atom to check distance to center with + +//Magic constants obtained by using linear regression on right-angled triangles of sides 0=b) + return (k1*a) + (k2*b) //No sqrt or powers :) + else + return (k1*b) + (k2*a) +#undef k1 +#undef k2 /proc/circlerange(center=usr,radius=3) diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index 4a890eba3f8..3ee76f591cb 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -919,7 +919,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl // ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE ------- return 0 - if (!( usr.restrained() || usr.lying )) + if (!( usr.restrained() || (usr.lying && usr.buckled!=src) )) // ------- YOU ARE NOT REASTRAINED ------- if (W) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index f60336edbc2..0138c2c8c9b 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -1,3 +1,5 @@ +#define USE_CIRCULAR_EXPLOSIONS 1 + //TODO: Flash range does nothing currently proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1) @@ -25,8 +27,11 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa var/list/expTurfs = list() // All turfs being affected by the explosion (not flash range) + #ifdef USE_CIRCULAR_EXPLOSIONS expTurfs = circlerangeturfs(epicenter, max(devastation_range, heavy_impact_range, light_impact_range)) - + #else + expTurfs = range(epicenter, max(devastation_range, heavy_impact_range, light_impact_range)) + #endif // Hello future editors, please note that 1000 calls to spawn will not speed this up, but this exact amount has been tested // Now, tonnes of calls to spawn will allow other stuff to happen, but I believe we may as well let explosions @@ -37,7 +42,7 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa var/list/lTurfs = list() for(var/turf/T in expTurfs) // This doesn't slow it down at all, even 100,100,100 bombs - var/dist = circledistance(epicenter, T) + var/dist = approx_dist(epicenter, T) if(dist < devastation_range) dTurfs.Add(T) @@ -54,7 +59,6 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa T.ex_act(1) for(var/atom/object in T.contents) object.ex_act(1) - spawn() for(var/turf/T in hTurfs) T.ex_act(2) @@ -69,9 +73,9 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa if(defer_powernet_rebuild != 2) defer_powernet_rebuild = 0 - return 1 +#undef USE_CIRCULAR_EXPLOSIONS proc/secondaryexplosion(turf/epicenter, range) diff --git a/code/game/objects/storage/storage.dm b/code/game/objects/storage/storage.dm index 05fb1f76336..40cd4e7b2e9 100644 --- a/code/game/objects/storage/storage.dm +++ b/code/game/objects/storage/storage.dm @@ -201,10 +201,6 @@ src.show_to(usr) return -/obj/item/weapon/storage/attack_paw(mob/user as mob) - //playsound(src.loc, "rustle", 50, 1, -5) // what - return src.attack_hand(user) - /obj/item/weapon/storage/attack_hand(mob/user as mob) playsound(src.loc, "rustle", 50, 1, -5) diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index c3f8fb52110..d3bce83024e 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -615,20 +615,25 @@ usr.update_inv_handcuffed() //unbuckling yourself - else if(usr:handcuffed && (usr.last_special <= world.time) && usr:buckled) - usr.next_move = world.time + 100 - usr.last_special = world.time + 100 - usr << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)" - for(var/mob/O in viewers(usr)) - O.show_message("\red [usr] attempts to unbuckle themself!", 1) - spawn(0) - if(do_after(usr, 1200)) - if(!usr:buckled) - return - for(var/mob/O in viewers(usr)) - O.show_message("\red [usr] manages to unbuckle themself!", 1) - usr << "\blue You successfully unbuckle yourself." - usr:buckled.manual_unbuckle(usr) + else if( usr:buckled && (usr.last_special <= world.time) ) + if( usr:handcuffed ) + usr.next_move = world.time + 100 + usr.last_special = world.time + 100 + usr << "\red You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)" + for(var/mob/O in viewers(usr)) + O.show_message("\red [usr] attempts to unbuckle themself!", 1) + spawn(0) + if(do_after(usr, 1200)) + if(!usr:buckled) + return + for(var/mob/O in viewers(usr)) + O.show_message("\red [usr] manages to unbuckle themself!", 1) + usr << "\blue You successfully unbuckle yourself." + usr:buckled.manual_unbuckle(usr) + else + usr:buckled.manual_unbuckle(usr) + + else if( src.loc && (istype(src.loc, /obj/structure/closet)) ) var/obj/structure/closet/C = usr.loc if(C.opened)