Replace gluttonous magic numbers with defines

This commit is contained in:
Daranz
2016-02-01 04:31:00 +13:00
parent 3395f7eb99
commit c5aaa9be31
7 changed files with 14 additions and 9 deletions
+5
View File
@@ -117,6 +117,11 @@
#define MOB_TINY 5
#define MOB_MINISCULE 1
// Gluttony levels.
#define GLUT_TINY 1 // Eat anything tiny and smaller
#define GLUT_SMALLER 2 // Eat anything smaller than we are
#define GLUT_ANYTHING 3 // Eat anything, ever
#define TINT_NONE 0
#define TINT_MODERATE 1
#define TINT_HEAVY 2
@@ -26,7 +26,7 @@
cold_level_3 = 0
eyes = "vox_eyes_s"
gluttonous = 2
gluttonous = GLUT_SMALLER
breath_type = "nitrogen"
poison_type = "oxygen"
@@ -121,7 +121,7 @@
var/primitive_form // Lesser form, if any (ie. monkey for humans)
var/greater_form // Greater form, if any, ie. human for monkeys.
var/holder_type
var/gluttonous // Can eat some mobs. 1 = eat MOB_TINY and below, 2 = eat anything we're larger than, 3 = eat anything
var/gluttonous // Can eat some mobs. Values can be GLUT_TINY, GLUT_SMALLER, GLUT_ANYTHING.
var/rarity_value = 1 // Relative rarity/collector value for this species.
// Determines the organs that the species spawns with and
var/list/has_organ = list( // which required-organ checks are conducted.
@@ -30,7 +30,7 @@
mob_size = MOB_SMALL
holder_type = /obj/item/weapon/holder/human
short_sighted = 1
gluttonous = 1
gluttonous = GLUT_TINY
spawn_flags = CAN_JOIN | IS_WHITELISTED
appearance_flags = HAS_HAIR_COLOR | HAS_SKIN_COLOR | HAS_EYE_COLOR
@@ -28,7 +28,7 @@
unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp)
primitive_form = "Stok"
darksight = 3
gluttonous = 1
gluttonous = GLUT_TINY
slowdown = 0.5
brute_mod = 0.8
num_alternate_languages = 2
@@ -87,7 +87,7 @@
slowdown = -0.5
brute_mod = 1.15
burn_mod = 1.15
gluttonous = 1
gluttonous = GLUT_TINY
num_alternate_languages = 2
secondary_langs = list("Siik'tajr")
name_language = "Siik'tajr"
@@ -11,7 +11,7 @@
has_fine_manipulation = 0
siemens_coefficient = 0
gluttonous = 3
gluttonous = GLUT_ANYTHING
eyes = "blank_eyes"
+3 -3
View File
@@ -147,11 +147,11 @@
else
var/mob/living/carbon/human/H = user
if(istype(H) && H.species.gluttonous && (iscarbon(target) || isanimal(target)))
if(H.species.gluttonous == 1 && (target.mob_size <= MOB_TINY) && !ishuman(target)) // Anything MOB_TINY or smaller
if(H.species.gluttonous == GLUT_TINY && (target.mob_size <= MOB_TINY) && !ishuman(target)) // Anything MOB_TINY or smaller
can_eat = 1
else if(H.species.gluttonous == 2 && (H.mob_size > target.mob_size)) // Anything we're larger than
else if(H.species.gluttonous == GLUT_SMALLER && (H.mob_size > target.mob_size)) // Anything we're larger than
can_eat = 1
else if(H.species.gluttonous == 3) // Eat anything ever
else if(H.species.gluttonous == GLUT_ANYTHING) // Eat anything ever
can_eat = 2
if(can_eat)