From 7173a8fe9fe3204c9f9f74ea9258f336148d15f2 Mon Sep 17 00:00:00 2001 From: Markolie Date: Fri, 21 Oct 2016 17:21:23 +0200 Subject: [PATCH] Fix aliens double attacking, tank examining and ATM security level 0 interaction --- .../game/objects/items/weapons/tanks/tanks.dm | 9 +- code/modules/economy/ATM.dm | 92 ++++++++++--------- .../living/carbon/alien/humanoid/humanoid.dm | 64 ------------- 3 files changed, 52 insertions(+), 113 deletions(-) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index d498109b2dd..87e8d52db54 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -78,13 +78,12 @@ /obj/item/weapon/tank/examine(mob/user) + if(!..(user, 0)) + return + var/obj/icon = src if(istype(loc, /obj/item/assembly)) icon = loc - if(!in_range(src, user)) - if(icon == src) - to_chat(user, "It's \a [bicon(icon)][src]! If you want any more information you'll need to get closer.") - return var/celsius_temperature = air_contents.temperature-T0C var/descriptive @@ -102,7 +101,7 @@ else descriptive = "furiously hot" - to_chat(user, "\blue \The [bicon(icon)][src] feels [descriptive]") + to_chat(user, "\The [bicon(icon)][src] feels [descriptive]") return diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index caca591b90b..b583c04702f 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -123,8 +123,6 @@ log transactions to_chat(user, "\red Artificial unit recognized. Artificial units do not currently receive monetary compensation, as per Nanotrasen regulation #1005.") return if(get_dist(src,user) <= 1) - //check to see if the user has low security enabled - scan_user(user) add_fingerprint(user) //js replicated from obj/machinery/computer/card @@ -252,55 +250,59 @@ log transactions var/new_sec_level = max( min(text2num(href_list["new_security_level"]), 2), 0) authenticated_account.security_level = new_sec_level if("attempt_auth") - if(linked_db && !ticks_left_locked_down) - var/tried_account_num = text2num(href_list["account_num"]) - if(!tried_account_num) - tried_account_num = held_card.associated_account_number - var/tried_pin = text2num(href_list["account_pin"]) + if(linked_db) + // check if they have low security enabled + scan_user(usr) + + if(!ticks_left_locked_down && held_card) + var/tried_account_num = text2num(href_list["account_num"]) + if(!tried_account_num) + tried_account_num = held_card.associated_account_number + var/tried_pin = text2num(href_list["account_pin"]) - authenticated_account = attempt_account_access(tried_account_num, tried_pin, held_card && held_card.associated_account_number == tried_account_num ? 2 : 1) - if(!authenticated_account) - number_incorrect_tries++ - if(previous_account_number == tried_account_num) - if(number_incorrect_tries > max_pin_attempts) - //lock down the atm - ticks_left_locked_down = 30 - playsound(src, 'sound/machines/buzz-two.ogg', 50, 1) + authenticated_account = attempt_account_access(tried_account_num, tried_pin, held_card && held_card.associated_account_number == tried_account_num ? 2 : 1) + if(!authenticated_account) + number_incorrect_tries++ + if(previous_account_number == tried_account_num) + if(number_incorrect_tries > max_pin_attempts) + //lock down the atm + ticks_left_locked_down = 30 + playsound(src, 'sound/machines/buzz-two.ogg', 50, 1) - //create an entry in the account transaction log - var/datum/money_account/failed_account = linked_db.get_account(tried_account_num) - if(failed_account) - var/datum/transaction/T = new() - T.target_name = failed_account.owner_name - T.purpose = "Unauthorised login attempt" - T.source_terminal = machine_id - T.date = current_date_string - T.time = worldtime2text() - failed_account.transaction_log.Add(T) + //create an entry in the account transaction log + var/datum/money_account/failed_account = linked_db.get_account(tried_account_num) + if(failed_account) + var/datum/transaction/T = new() + T.target_name = failed_account.owner_name + T.purpose = "Unauthorised login attempt" + T.source_terminal = machine_id + T.date = current_date_string + T.time = worldtime2text() + failed_account.transaction_log.Add(T) + else + to_chat(usr, "\red [bicon(src)] Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining.") + previous_account_number = tried_account_num + playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 1) else - to_chat(usr, "\red [bicon(src)] Incorrect pin/account combination entered, [max_pin_attempts - number_incorrect_tries] attempts remaining.") - previous_account_number = tried_account_num - playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 1) + to_chat(usr, "\red [bicon(src)] incorrect pin/account combination entered.") + number_incorrect_tries = 0 else - to_chat(usr, "\red [bicon(src)] incorrect pin/account combination entered.") - number_incorrect_tries = 0 - else - playsound(src, 'sound/machines/twobeep.ogg', 50, 1) - ticks_left_timeout = 120 - view_screen = NO_SCREEN + playsound(src, 'sound/machines/twobeep.ogg', 50, 1) + ticks_left_timeout = 120 + view_screen = NO_SCREEN - //create a transaction log entry - var/datum/transaction/T = new() - T.target_name = authenticated_account.owner_name - T.purpose = "Remote terminal access" - T.source_terminal = machine_id - T.date = current_date_string - T.time = worldtime2text() - authenticated_account.transaction_log.Add(T) + //create a transaction log entry + var/datum/transaction/T = new() + T.target_name = authenticated_account.owner_name + T.purpose = "Remote terminal access" + T.source_terminal = machine_id + T.date = current_date_string + T.time = worldtime2text() + authenticated_account.transaction_log.Add(T) - to_chat(usr, "\blue [bicon(src)] Access granted. Welcome user '[authenticated_account.owner_name].'") + to_chat(usr, "\blue [bicon(src)] Access granted. Welcome user '[authenticated_account.owner_name].'") - previous_account_number = tried_account_num + previous_account_number = tried_account_num if("withdrawal") var/amount = max(text2num(href_list["funds_amount"]),0) if(amount <= 0) @@ -404,3 +406,5 @@ log transactions T.date = current_date_string T.time = worldtime2text() authenticated_account.transaction_log.Add(T) + + view_screen = NO_SCREEN diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 5692c99e9be..876cae4b312 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -243,70 +243,6 @@ visible_message("[M] has attempted to disarm [src]!") return -/*Code for aliens attacking aliens. Because aliens act on a hivemind, I don't see them as very aggressive with each other. -As such, they can either help or harm other aliens. Help works like the human help command while harm is a simple nibble. -In all, this is a lot like the monkey code. /N -*/ - -/mob/living/carbon/alien/humanoid/attack_alien(mob/living/carbon/alien/humanoid/M as mob) - if(!ticker) - to_chat(M, "You cannot attack people before the game has started.") - return - - if(istype(loc, /turf) && istype(loc.loc, /area/start)) - to_chat(M, "No attacking people at spawn, you jackass.") - return - - ..() - - switch(M.a_intent) - - if(I_HELP) - sleeping = max(0,sleeping-5) - resting = 0 - AdjustParalysis(-3) - AdjustStunned(-3) - AdjustWeakened(-3) - visible_message("[M.name] nuzzles [src] trying to wake it up!") - - else - if(health > 0) - M.do_attack_animation(src) - playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) - var/damage = rand(1, 3) - visible_message("[M.name] bites [src]!!", \ - "[M.name] bites [src]!!") - - adjustBruteLoss(damage) - updatehealth() - else - to_chat(M, "[name] is too injured for that.") - return - - -/mob/living/carbon/alien/humanoid/attack_larva(mob/living/carbon/alien/larva/L as mob) - - switch(L.a_intent) - if(I_HELP) - visible_message("[L] rubs its head against [src].") - - - else - if(health > 0) - L.do_attack_animation(src) - playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1) - var/damage = rand(1, 3) - visible_message("[L.name] bites [src]!!", \ - "[L.name] bites [src]!!") - - adjustBruteLoss(damage) - updatehealth() - else - to_chat(L, "[name] is too injured for that.") - return - - - /mob/living/carbon/alien/humanoid/restrained() if(handcuffed) return 1