Moved scooping into a separate helper.

This commit is contained in:
Chinsky
2014-06-24 13:46:15 +04:00
parent 4da1a5302e
commit 481f3caec5
5 changed files with 23 additions and 26 deletions

View File

@@ -34,6 +34,22 @@
for(var/mob/living/M in contents)
M.show_message(message,m_type)
//Mob procs and vars for scooping up
/mob/living/var/holder_type
/mob/living/proc/get_scooped(var/mob/living/carbon/grabber)
if(!holder_type)
return
var/obj/item/weapon/holder/H = new holder_type(loc)
src.loc = H
H.name = loc.name
H.attack_hand(grabber)
grabber << "You scoop up [src]."
src << "[grabber] scoops you up."
grabber.status_flags |= PASSEMOTES
return
//Mob specific holders.
/obj/item/weapon/holder/diona

View File

@@ -12,6 +12,7 @@
var/ready_evolve = 0
universal_understand = 0 // Dionaea do not need to speak to people
universal_speak = 0 // before becoming an adult. Use *chirp.
holder_type = /obj/item/weapon/holder/diona
/mob/living/carbon/monkey/diona/attack_hand(mob/living/carbon/human/M as mob)
@@ -24,14 +25,7 @@
src.verbs -= /mob/living/carbon/monkey/diona/proc/merge
src.loc = M
else
var/obj/item/weapon/holder/diona/D = new(loc)
src.loc = D
D.name = loc.name
D.attack_hand(M)
M << "You scoop up [src]."
src << "[M] scoops you up."
M.status_flags |= PASSEMOTES
return
get_scooped(M)
..()

View File

@@ -25,8 +25,7 @@
//Used for self-mailing.
var/mail_destination = ""
//Used for pulling.
holder_type = /obj/item/weapon/holder/drone
/mob/living/silicon/robot/drone/New()
..()

View File

@@ -47,12 +47,5 @@
/mob/living/silicon/robot/drone/attack_hand(mob/living/carbon/human/M as mob)
if(M.a_intent == "help")
var/obj/item/weapon/holder/drone/D = new(loc)
src.loc = D
D.attack_hand(M)
M << "You scoop up [src]."
src << "[M] scoops you up."
M.status_flags |= PASSEMOTES
return
get_scooped(M)
..()

View File

@@ -21,6 +21,7 @@
min_oxy = 16 //Require atleast 16kPA oxygen
minbodytemp = 223 //Below -50 Degrees Celcius
maxbodytemp = 323 //Above 50 Degrees Celcius
holder_type = /obj/item/weapon/holder/cat
/mob/living/simple_animal/cat/Life()
//MICE!
@@ -63,18 +64,12 @@
/mob/living/simple_animal/cat/MouseDrop(atom/over_object)
var/mob/living/carbon/human/H = over_object
var/mob/living/carbon/H = over_object
if(!istype(H)) return ..()
//This REALLY needs to be moved to a general mob proc somewhere.
if(H.a_intent == "help")
var/obj/item/weapon/holder/cat/C = new(loc)
src.loc = C
C.name = loc.name
C.attack_hand(H)
H << "You scoop up [src]."
src << "[H] scoops you up."
H.status_flags |= PASSEMOTES
get_scooped(H)
return
else
return ..()