mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
Added a swing mechanic.
This commit is contained in:
@@ -259,6 +259,26 @@ mob/proc/flash_weak_pain()
|
||||
user.lastattacked = M
|
||||
M.lastattacker = user
|
||||
|
||||
var/power = src.force
|
||||
|
||||
// EXPERIMENTAL: scale power and time to the weight class
|
||||
if(w_class >= 4.0 && !istype(src,/obj/item/weapon/melee/energy/blade)) // eswords are an exception, they only have a w_class of 4 to not fit into pockets
|
||||
power = power * 2.5
|
||||
|
||||
user.visible_message("\red [user.name] swings at [M.name] with \the [src]!")
|
||||
user.next_move = max(user.next_move, world.time + 30)
|
||||
|
||||
// if the mob didn't move, he has a 100% chance to hit(given the enemy also didn't move)
|
||||
// otherwise, the chance to hit is lower
|
||||
var/unmoved = 0
|
||||
spawn
|
||||
unmoved = do_after(user, 4)
|
||||
sleep(4)
|
||||
if( (!unmoved && !prob(70)) || get_dist(user, M) != 1)
|
||||
user.visible_message("\red [user.name] misses with \the [src]!")
|
||||
return
|
||||
|
||||
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
log_admin("ATTACK: [user] ([user.ckey]) attacked [M] ([M.ckey]) with [src].")
|
||||
@@ -268,13 +288,6 @@ mob/proc/flash_weak_pain()
|
||||
// M.lastattacker = null
|
||||
/////////////////////////
|
||||
|
||||
var/power = src.force
|
||||
|
||||
// EXPERIMENTAL: scale power and time to the weight class
|
||||
if(w_class >= 4.0)
|
||||
power = power * 2
|
||||
user.next_move = max(user.next_move, world.time + 20)
|
||||
|
||||
if(!istype(M, /mob/living/carbon/human))
|
||||
if(istype(M, /mob/living/carbon/metroid))
|
||||
var/mob/living/carbon/metroid/Metroid = M
|
||||
|
||||
Reference in New Issue
Block a user