- Parrots now have absolutely gorgeous sprites thanks to Pewtershmitz
- Removed a few "world <<"s that I missed
- Fixed parrots picking up their own headset (and duplicating it)
- Fixed parrots not properly running away from carbon mobs

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4704 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
johnsonmt88@gmail.com
2012-09-16 18:34:39 +00:00
parent 2717517f17
commit caa3f8055d
3 changed files with 19 additions and 42 deletions

View File

@@ -33,9 +33,9 @@
name = "\improper Parrot" name = "\improper Parrot"
desc = "The parrot squacks, \"It's a Parrot! BAWWK!\"" desc = "The parrot squacks, \"It's a Parrot! BAWWK!\""
icon = 'icons/mob/animal.dmi' icon = 'icons/mob/animal.dmi'
icon_state = "chick" icon_state = "parrot_fly"
icon_living = "chick" icon_living = "parrot_fly"
icon_dead = "chick_dead" icon_dead = "parrot_sit "
pass_flags = PASSTABLE pass_flags = PASSTABLE
speak = list("Hi","Hello!","Cracker?","BAWWWWK george mellons griffing me") speak = list("Hi","Hello!","Cracker?","BAWWWWK george mellons griffing me")
@@ -181,13 +181,16 @@
..() ..()
if(client) return if(client) return
if(!stat && M.a_intent == "hurt") if(!stat && M.a_intent == "hurt")
icon_state = "parrot_fly" //It is going to be flying regardless of whether it flees or attacks
if(parrot_state == PARROT_PERCH) if(parrot_state == PARROT_PERCH)
parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched
parrot_interest = M parrot_interest = M
parrot_state = PARROT_SWOOP //The parrot just got hit, it WILL move, now to pick a direction.. parrot_state = PARROT_SWOOP //The parrot just got hit, it WILL move, now to pick a direction..
if(M.getMaxHealth() - M.health < 50) //Weakened mob? Fight back! if(M.health < 50) //Weakened mob? Fight back!
parrot_state |= PARROT_ATTACK parrot_state |= PARROT_ATTACK
else else
parrot_state |= PARROT_FLEE //Otherwise, fly like a bat out of hell! parrot_state |= PARROT_FLEE //Otherwise, fly like a bat out of hell!
@@ -204,12 +207,14 @@
/mob/living/simple_animal/parrot/attack_animal(mob/living/simple_animal/M as mob) /mob/living/simple_animal/parrot/attack_animal(mob/living/simple_animal/M as mob)
if(client) return if(client) return
if(parrot_state == PARROT_PERCH) if(parrot_state == PARROT_PERCH)
parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched
if(M.melee_damage_upper > 0) if(M.melee_damage_upper > 0)
parrot_interest = M parrot_interest = M
parrot_state = PARROT_SWOOP | PARROT_ATTACK //Attack other animals regardless parrot_state = PARROT_SWOOP | PARROT_ATTACK //Attack other animals regardless
icon_state = "parrot_fly"
//Mobs with objects //Mobs with objects
/mob/living/simple_animal/parrot/attackby(var/obj/item/O as obj, var/mob/user as mob) /mob/living/simple_animal/parrot/attackby(var/obj/item/O as obj, var/mob/user as mob)
@@ -221,6 +226,7 @@
parrot_interest = user parrot_interest = user
parrot_state = PARROT_SWOOP | PARROT_FLEE parrot_state = PARROT_SWOOP | PARROT_FLEE
icon_state = "parrot_fly"
drop_held_item(0) drop_held_item(0)
return return
@@ -233,6 +239,7 @@
parrot_interest = null parrot_interest = null
parrot_state = PARROT_WANDER //OWFUCK, Been shot! RUN LIKE HELL! parrot_state = PARROT_WANDER //OWFUCK, Been shot! RUN LIKE HELL!
icon_state = "parrot_fly"
drop_held_item(0) drop_held_item(0)
return return
@@ -253,44 +260,41 @@
//Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list. //Every once in a while, the parrot picks one of the lines from the buffer and replaces an element of the 'speech' list.
//Then it clears the buffer to make sure they dont magically remember something from hours ago. //Then it clears the buffer to make sure they dont magically remember something from hours ago.
if(speech_buffer.len && prob(10)) if(speech_buffer.len && prob(10))
// world << "New speech being added!"
if(speak.len) if(speak.len)
speak.Remove(pick(speak)) speak.Remove(pick(speak))
speak.Add(pick(speech_buffer)) speak.Add(pick(speech_buffer))
clearlist(speech_buffer) clearlist(speech_buffer)
// world << "State: [parrot_state]"
//Alright, here we go... down the slope //Alright, here we go... down the slope
//-----SLEEPING //-----SLEEPING
if(parrot_state == PARROT_PERCH) if(parrot_state == PARROT_PERCH)
// world << "Perched"
if(parrot_perch.loc != src.loc) //Make sure someone hasnt moved our perch on us if(parrot_perch.loc != src.loc) //Make sure someone hasnt moved our perch on us
if(parrot_perch in view(src)) if(parrot_perch in view(src))
parrot_state = PARROT_SWOOP | PARROT_RETURN parrot_state = PARROT_SWOOP | PARROT_RETURN
icon_state = "parrot_fly"
return return
else else
parrot_state = PARROT_WANDER parrot_state = PARROT_WANDER
icon_state = "parrot_fly"
return return
if(--parrot_sleep_dur) //Zzz if(--parrot_sleep_dur) //Zzz
// world << "Perched: sleeping"
return return
else else
// world << "Perched: looking around"
parrot_sleep_dur = parrot_sleep_max //This way we only call the loop below once every [sleep_max] ticks. parrot_sleep_dur = parrot_sleep_max //This way we only call the loop below once every [sleep_max] ticks.
parrot_interest = search_for_item() parrot_interest = search_for_item()
if(parrot_interest) if(parrot_interest)
emote("[src] looks in [parrot_interest]'s direction and takes flight.") emote("[src] looks in [parrot_interest]'s direction and takes flight.")
parrot_state = PARROT_SWOOP | PARROT_STEAL parrot_state = PARROT_SWOOP | PARROT_STEAL
icon_state = "parrot_fly"
return return
//-----WANDERING - This is basically a 'I dont know what to do yet' state //-----WANDERING - This is basically a 'I dont know what to do yet' state
else if(parrot_state == PARROT_WANDER) else if(parrot_state == PARROT_WANDER)
// world << "Wander"
//Stop movement, we'll set it later //Stop movement, we'll set it later
walk(src, 0) walk(src, 0)
parrot_interest = null parrot_interest = null
@@ -298,25 +302,20 @@
//Wander around aimlessly. This will help keep the loops from searches down //Wander around aimlessly. This will help keep the loops from searches down
//and possibly move the mob into a new are in view of something they can use //and possibly move the mob into a new are in view of something they can use
if(prob(90)) if(prob(90))
// world << "Wander: randomly"
step(src, pick(cardinal)) step(src, pick(cardinal))
return return
if(!held_item && !parrot_perch) //If we've got nothing to do.. look for something to do. if(!held_item && !parrot_perch) //If we've got nothing to do.. look for something to do.
// world << "Wander: looking for perch or item"
// world << parrot_interest
var/atom/movable/AM = search_for_perch_and_item() //This handles checking through lists so we know it's either a perch or stealable item var/atom/movable/AM = search_for_perch_and_item() //This handles checking through lists so we know it's either a perch or stealable item
if(AM) if(AM)
if(istype(AM, /obj/item) || isliving(AM)) //If stealable item if(istype(AM, /obj/item) || isliving(AM)) //If stealable item
parrot_interest = AM parrot_interest = AM
emote("[src] turns and flies towards [parrot_interest].") emote("[src] turns and flies towards [parrot_interest].")
parrot_state = PARROT_SWOOP | PARROT_STEAL parrot_state = PARROT_SWOOP | PARROT_STEAL
world << parrot_interest
return return
else //Else it's a perch else //Else it's a perch
parrot_perch = AM parrot_perch = AM
parrot_state = PARROT_SWOOP | PARROT_RETURN parrot_state = PARROT_SWOOP | PARROT_RETURN
world << parrot_interest
return return
return return
@@ -325,32 +324,26 @@
return return
if(parrot_perch && parrot_perch in view(src)) if(parrot_perch && parrot_perch in view(src))
// world << "Wander: returning to perch"
parrot_state = PARROT_SWOOP | PARROT_RETURN parrot_state = PARROT_SWOOP | PARROT_RETURN
return return
else //Have an item but no perch? Find one! else //Have an item but no perch? Find one!
// world << "Wander: looking for perch, holding item"
parrot_perch = search_for_perch() parrot_perch = search_for_perch()
if(parrot_perch) if(parrot_perch)
parrot_state = PARROT_SWOOP | PARROT_RETURN parrot_state = PARROT_SWOOP | PARROT_RETURN
return return
//-----STEALING //-----STEALING
else if(parrot_state == (PARROT_SWOOP | PARROT_STEAL)) else if(parrot_state == (PARROT_SWOOP | PARROT_STEAL))
// world << "Steal"
walk(src,0) walk(src,0)
if(!parrot_interest || held_item) if(!parrot_interest || held_item)
// world << "Steal: lost interest or holding an item"
parrot_state = PARROT_SWOOP | PARROT_RETURN parrot_state = PARROT_SWOOP | PARROT_RETURN
return return
if(!(parrot_interest in view(src))) if(!(parrot_interest in view(src)))
// world << "Steal: interest not in view"
parrot_state = PARROT_SWOOP | PARROT_RETURN parrot_state = PARROT_SWOOP | PARROT_RETURN
return return
if(in_range(src, parrot_interest)) if(in_range(src, parrot_interest))
// world << "Steal: stealing item"
if(isliving(parrot_interest)) if(isliving(parrot_interest))
steal_from_mob() steal_from_mob()
else else
@@ -360,7 +353,6 @@
parrot_state = PARROT_SWOOP | PARROT_RETURN parrot_state = PARROT_SWOOP | PARROT_RETURN
return return
// world << "Steal: swooping closer to target"
var/oldloc = src.loc var/oldloc = src.loc
step_towards(src, get_step_towards(src,parrot_interest)) step_towards(src, get_step_towards(src,parrot_interest))
if(src.loc == oldloc) //Check if the mob is stuck if(src.loc == oldloc) //Check if the mob is stuck
@@ -370,22 +362,19 @@
//-----RETURNING TO PERCH //-----RETURNING TO PERCH
else if(parrot_state == (PARROT_SWOOP | PARROT_RETURN)) else if(parrot_state == (PARROT_SWOOP | PARROT_RETURN))
// world << "Return"
walk(src, 0) walk(src, 0)
if(!parrot_perch || !isturf(parrot_perch.loc)) //Make sure the perch exists and somehow isnt inside of something else. if(!parrot_perch || !isturf(parrot_perch.loc)) //Make sure the perch exists and somehow isnt inside of something else.
world << "Return: no perch?"
parrot_perch = null parrot_perch = null
parrot_state = PARROT_WANDER parrot_state = PARROT_WANDER
return return
if(in_range(src, parrot_perch)) if(in_range(src, parrot_perch))
// world << "Return: landing"
src.loc = parrot_perch.loc src.loc = parrot_perch.loc
drop_held_item() drop_held_item()
parrot_state = PARROT_PERCH parrot_state = PARROT_PERCH
icon_state = "parrot_sit"
return return
// world << "Return: returning to perch"
var/oldloc = src.loc var/oldloc = src.loc
step_towards(src, get_step_towards(src,parrot_perch)) step_towards(src, get_step_towards(src,parrot_perch))
if(src.loc == oldloc) //Check if the mob is stuck if(src.loc == oldloc) //Check if the mob is stuck
@@ -394,13 +383,10 @@
//-----FLEEING //-----FLEEING
else if(parrot_state == (PARROT_SWOOP | PARROT_FLEE)) else if(parrot_state == (PARROT_SWOOP | PARROT_FLEE))
// world << "Flee"
walk(src,0) walk(src,0)
if(!parrot_interest || !isliving(parrot_interest)) //Sanity if(!parrot_interest || !isliving(parrot_interest)) //Sanity
world << "Flee: lost interest"
parrot_state = PARROT_WANDER parrot_state = PARROT_WANDER
// world << "Flee: fleeing"
var/oldloc = src.loc var/oldloc = src.loc
step(src, get_step_away(src, parrot_interest)) step(src, get_step_away(src, parrot_interest))
if(src.loc == oldloc) //Check if the mob is stuck if(src.loc == oldloc) //Check if the mob is stuck
@@ -408,11 +394,9 @@
//-----ATTACKING //-----ATTACKING
else if(parrot_state == (PARROT_SWOOP | PARROT_ATTACK)) else if(parrot_state == (PARROT_SWOOP | PARROT_ATTACK))
// world << "Attack"
//If we're attacking a nothing, an object, a turf or a ghost for some stupid reason, switch to wander //If we're attacking a nothing, an object, a turf or a ghost for some stupid reason, switch to wander
if(!parrot_interest || !isliving(parrot_interest)) if(!parrot_interest || !isliving(parrot_interest))
// world << "Attack: lost interest"
parrot_interest = null parrot_interest = null
parrot_state = PARROT_WANDER parrot_state = PARROT_WANDER
return return
@@ -424,7 +408,6 @@
//If the mob we've been chasing/attacking dies or falls into crit, check for loot! //If the mob we've been chasing/attacking dies or falls into crit, check for loot!
if(L.stat) if(L.stat)
// world << "Attack: looting body"
parrot_interest = null parrot_interest = null
if(!held_item) if(!held_item)
held_item = steal_from_ground() held_item = steal_from_ground()
@@ -440,7 +423,6 @@
var/damage = rand(5,10) var/damage = rand(5,10)
if(ishuman(parrot_interest)) if(ishuman(parrot_interest))
// world << "Attack: attacking human"
var/mob/living/carbon/human/H = parrot_interest var/mob/living/carbon/human/H = parrot_interest
var/datum/organ/external/affecting = H.get_organ(ran_zone(pick(parrot_dam_zone))) var/datum/organ/external/affecting = H.get_organ(ran_zone(pick(parrot_dam_zone)))
@@ -448,14 +430,12 @@
emote(pick("pecks [H]'s [affecting]", "cuts [H]'s [affecting] with its talons")) emote(pick("pecks [H]'s [affecting]", "cuts [H]'s [affecting] with its talons"))
else else
// world << "Attack: attacking non-human"
L.adjustBruteLoss(damage) L.adjustBruteLoss(damage)
emote(pick("pecks at [L]", "claws [L]")) emote(pick("pecks at [L]", "claws [L]"))
return return
//Otherwise, fly towards the mob! //Otherwise, fly towards the mob!
else else
// world << "Attack: swooping towards the mob"
var/oldloc = src.loc var/oldloc = src.loc
step_towards(src, get_step_towards(src,parrot_interest)) step_towards(src, get_step_towards(src,parrot_interest))
if(src.loc == oldloc) //Check if the mob is stuck if(src.loc == oldloc) //Check if the mob is stuck
@@ -463,7 +443,6 @@
//-----STATE MISHAP //-----STATE MISHAP
else //This should not happen. If it does lets reset everything and try again else //This should not happen. If it does lets reset everything and try again
// world << "Unknown state: resetting to wander"
walk(src,0) walk(src,0)
parrot_interest = null parrot_interest = null
parrot_perch = null parrot_perch = null
@@ -478,7 +457,7 @@
/mob/living/simple_animal/parrot/proc/search_for_item() /mob/living/simple_animal/parrot/proc/search_for_item()
for(var/atom/movable/AM in view(src)) for(var/atom/movable/AM in view(src))
for(var/path in desired_items) for(var/path in desired_items)
if(parrot_perch && AM.loc == parrot_perch.loc) //Skip items we already stole if(parrot_perch && AM.loc == parrot_perch.loc || AM.loc == src) //Skip items we already stole or are wearing
continue continue
if(istype(AM, path)) if(istype(AM, path))
@@ -505,7 +484,7 @@
return AM return AM
for(var/item_path in desired_items) for(var/item_path in desired_items)
if(parrot_perch && AM.loc == parrot_perch.loc) //Skip items we already stole if(parrot_perch && AM.loc == parrot_perch.loc || AM.loc == src) //Skip items we already stole or are wearing
continue continue
if(istype(AM, item_path)) if(istype(AM, item_path))
@@ -535,7 +514,7 @@
for(var/obj/item/I in view(1,src)) for(var/obj/item/I in view(1,src))
for(var/path in desired_items) for(var/path in desired_items)
if(istype(I, path)) if(istype(I, path) && I.loc != src)
held_item = I held_item = I
I.loc = src I.loc = src
visible_message("[src] grabs the [held_item]!", "\blue You grab the [held_item]!", "You hear the sounds of wings flapping furiously.") visible_message("[src] grabs the [held_item]!", "\blue You grab the [held_item]!", "You hear the sounds of wings flapping furiously.")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View File

@@ -106,7 +106,6 @@
#define FILE_DIR "code/modules/clothing/shoes" #define FILE_DIR "code/modules/clothing/shoes"
#define FILE_DIR "code/modules/clothing/spacesuits" #define FILE_DIR "code/modules/clothing/spacesuits"
#define FILE_DIR "code/modules/clothing/suits" #define FILE_DIR "code/modules/clothing/suits"
#define FILE_DIR "code/modules/clothing/ties"
#define FILE_DIR "code/modules/clothing/under" #define FILE_DIR "code/modules/clothing/under"
#define FILE_DIR "code/modules/clothing/under/jobs" #define FILE_DIR "code/modules/clothing/under/jobs"
#define FILE_DIR "code/modules/critters" #define FILE_DIR "code/modules/critters"
@@ -206,9 +205,7 @@
#define FILE_DIR "icons/vending_icons" #define FILE_DIR "icons/vending_icons"
#define FILE_DIR "interface" #define FILE_DIR "interface"
#define FILE_DIR "maps" #define FILE_DIR "maps"
#define FILE_DIR "maps/backup"
#define FILE_DIR "maps/RandomZLevels" #define FILE_DIR "maps/RandomZLevels"
#define FILE_DIR "maps/RandomZLevels/backup"
#define FILE_DIR "sound" #define FILE_DIR "sound"
#define FILE_DIR "sound/AI" #define FILE_DIR "sound/AI"
#define FILE_DIR "sound/ambience" #define FILE_DIR "sound/ambience"
@@ -834,6 +831,7 @@
#include "code\modules\admin\verbs\mapping.dm" #include "code\modules\admin\verbs\mapping.dm"
#include "code\modules\admin\verbs\massmodvar.dm" #include "code\modules\admin\verbs\massmodvar.dm"
#include "code\modules\admin\verbs\modifyvariables.dm" #include "code\modules\admin\verbs\modifyvariables.dm"
#include "code\modules\admin\verbs\one_click_antag.dm"
#include "code\modules\admin\verbs\onlyone.dm" #include "code\modules\admin\verbs\onlyone.dm"
#include "code\modules\admin\verbs\playsound.dm" #include "code\modules\admin\verbs\playsound.dm"
#include "code\modules\admin\verbs\possess.dm" #include "code\modules\admin\verbs\possess.dm"