Fixing compile errors (#9)

This commit is contained in:
Werner
2016-11-18 18:03:27 +02:00
committed by skull132
parent effb9ececf
commit 3e92d63ddf
15 changed files with 311 additions and 67 deletions
+23
View File
@@ -63,6 +63,10 @@
#define BLOCKHEADHAIR 0x20 // Hides the user's hair overlay. Leaves facial hair.
#define BLOCKHAIR 0x40 // Hides the user's hair, facial and otherwise.
//This flag applies to gloves, uniforms, shoes, masks, ear items, glasses
#define ALWAYSDRAW 32//If set, this item is always rendered even if its slot is hidden by other clothing
//Note that the item may still not be visible if its sprite is actually covered up.
// Slots.
#define slot_back 1
#define slot_wear_mask 2
@@ -97,6 +101,25 @@
#define slot_head_str "slot_head"
#define slot_wear_suit_str "slot_suit"
//itemstate suffixes. Used for containedsprite worn items
#define WORN_LHAND "_lh"
#define WORN_RHAND "_rh"
#define WORN_LSTORE "_ls"
#define WORN_RSTORE "_rs"
#define WORN_SSTORE "_ss"
#define WORN_LEAR "_le"
#define WORN_REAR "_re"
#define WORN_HEAD "_he"
#define WORN_UNDER "_un"
#define WORN_SUIT "_su"
#define WORN_GLOVES "_gl"
#define WORN_SHOES "_sh"
#define WORN_EYES "_ey"
#define WORN_BELT "_be"
#define WORN_BACK "_ba"
#define WORN_ID "_id"
#define WORN_MASK "_ma"
// Bitflags for clothing parts.
#define HEAD 0x1
#define FACE 0x2
+25
View File
@@ -210,3 +210,28 @@
#define CAPTURE_MODE_REGULAR 0 //Regular polaroid camera mode
#define CAPTURE_MODE_ALL 1 //Admin camera mode
#define CAPTURE_MODE_PARTIAL 3 //Simular to regular mode, but does not do dummy check
//Sound effects toggles
#define ASFX_AMBIENCE 1
#define ASFX_FOOTSTEPS 2
#define ASFX_VOTE 4
//Cargo random stock vars
//These are used in randomstock.dm
//And also for generating random loot crates in crates.dm
#define TOTAL_STOCK 80//The total number of items we'll spawn in cargo stock
#define STOCK_UNCOMMON_PROB 23
//The probability, as a percentage for each item, that we'll choose from the uncommon spawns list
#define STOCK_RARE_PROB 2.8
//The probability, as a percentage for each item, that we'll choose from the rare spawns list
//If an item is not rare or uncommon, it will be chosen from the common spawns list.
//So the probability of a common item is 100 - (uncommon + rare)
#define STOCK_LARGE_PROB 75
//Large items are spawned on predetermined locations.
//For each large spawn marker, this is the chance that we will spawn there
+2 -2
View File
@@ -47,8 +47,8 @@ var/religion_name = null
return "Tau Ceti"
/proc/commstation_name()
if (commstation_name)
return commstation_name
if (dock_name)
return dock_name
/proc/station_name()
if (station_name)
+3 -1
View File
@@ -73,6 +73,8 @@
// Works similarly to worn sprite_sheets, except the alternate sprites are used when the clothing/refit_for_species() proc is called.
var/list/sprite_sheets_obj = list()
var/icon_override = null //Used to override hardcoded clothing dmis in human clothing pr
/obj/item/Destroy()
if(ismob(loc))
var/mob/m = loc
@@ -110,7 +112,7 @@
else
return
/obj/item/verb/move_to_top()
/obj/item/verb/move_to_top(obj/item/I in range(1))
set name = "Move To Top"
set category = "Object"
+10 -4
View File
@@ -108,6 +108,12 @@
return ..()
/obj/item/weapon/melee/baton/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
if(status && (CLUMSY in user.mutations) && prob(50))
user << "span class='danger'>You accidentally hit yourself with the [src]!</span>"
user.Weaken(30)
deductcharge(hitcost)
return
if(isrobot(target))
return ..()
@@ -141,11 +147,11 @@
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
//stun effects
L.stun_effect_act(stun, agony, target_zone, src)
target.stun_effect_act(stun, agony, hit_zone, src)
playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
msg_admin_attack("[key_name(user)] stunned [key_name(L)] with the [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
msg_admin_attack("[key_name(user)] stunned [key_name(target)] with the [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
if(status)
deductcharge(hitcost)
@@ -183,7 +189,7 @@
attack_verb = list("poked")
slot_flags = null
baton_color = "#FFDF00"
/obj/item/weapon/melee/baton/stunrod
name = "stunrod"
desc = "A more-than-lethal weapon used to deal with high threat situations."
+1 -1
View File
@@ -33,7 +33,7 @@ var/diary_date_string = null
var/href_logfile = null
var/station_name = "NSS Exodus"
var/station_short = "Exodus"
var/const/dock_name = "NMSS Odin"
var/const/dock_name = "NTCC Odin"
var/const/boss_name = "Central Command"
var/const/boss_short = "Centcomm"
var/const/company_name = "NanoTrasen"
+1
View File
@@ -82,6 +82,7 @@ var/list/ai_verbs_default = list(
var/bombing_station = 0 // Set to 1 if station nuke auto-destruct is activated
var/override_CPUStorage = 0 // Bonus/Penalty CPU Storage. For use by admins/testers.
var/override_CPURate = 0 // Bonus/Penalty CPU generation rate. For use by admins/testers.
var/list/cameraRecords = list() //For storing what is shown to the cameras
var/datum/ai_icon/selected_sprite // The selected icon set
var/custom_sprite = 0 // Whether the selected icon is custom
@@ -4,7 +4,6 @@
icon_state = "repairbot"
emote_type = 2 // pAIs emotes are heard, not seen, so they can be seen through a container (eg. person)
small = 1
pass_flags = PASSTABLE | PASSDOORHATCH
density = 0
mob_size = 1//As a holographic projection, a pAI is massless except for its card device
@@ -38,7 +38,6 @@ var/list/mob_hat_cache = list()
local_transmit = 1
possession_candidate = 1
mob_size = 4
small = 1
can_pull_size = 3
can_pull_mobs = MOB_PULL_SMALLER
@@ -21,7 +21,6 @@
var/last_squealgain = 0// #TODO-FUTURE: Remove from life() once something else is created
pass_flags = PASSTABLE
small = 1
speak_chance = 5
turns_per_move = 5
see_in_dark = 6
@@ -40,7 +40,6 @@
var/obj/item/held_item = null //Storage for single item they can hold.
speed = -1 //Spiderbots gotta go fast.
pass_flags = PASSTABLE | PASSDOORHATCH
small = 1
speak_emote = list("beeps","clicks","chirps")
/mob/living/simple_animal/spiderbot/New()
@@ -302,4 +301,4 @@
if (!underdoor)
spawn(3)//A slight delay to let us finish walking out from under the door
layer = initial(layer)
layer = initial(layer)
@@ -139,7 +139,6 @@
emote_see = list("sniffs the air cautiously","looks around")
emote_hear = list("snuffles")
pass_flags = PASSTABLE
small = 1
density = 0
mob_size = 3
@@ -172,7 +171,6 @@
icon_dead = "yithian_dead"
icon = 'icons/jungle.dmi'
pass_flags = PASSTABLE
small = 1
density = 0
mob_size = 2
@@ -184,6 +182,5 @@
icon_dead = "tindalos_dead"
icon = 'icons/jungle.dmi'
pass_flags = PASSTABLE
small = 1
density = 0
mob_size = 1.5
mob_size = 1.5
@@ -27,6 +27,8 @@
var/stop_automated_movement = 0 //Use this to temporarely stop random movement or to if you write special movement code for animals.
var/wander = 1 // Does the mob wander around when idle?
var/stop_automated_movement_when_pulled = 1 //When set to 1 this stops the animal from moving when someone is pulling it.
var/atom/movement_target = null//Thing we're moving towards
var/turns_since_scan = 0
//Interaction
var/response_help = "tries to help"
@@ -66,51 +68,109 @@
var/supernatural = 0
var/purge = 0
//Hunger/feeding vars
var/hunger_enabled = 1//If set to 0, a creature ignores hunger
var/max_nutrition = 50
var/metabolic_factor = 1//A multiplier on how fast nutrition is lost. used to tweak the rates on a per-animal basis
var/nutrition_step = 0.2 //nutrition lost per tick and per step, calculated from mob_size, 0.2 is a fallback
var/bite_factor = 0.4
var/digest_factor = 0.2 //A multiplier on how quickly reagents are digested
var/stomach_size_mult = 5
//Food behaviour vars
var/autoseek_food = 1//If 0. this animal will not automatically eat
var/beg_for_food = 1//If 0, this animal will not show interest in food held by a person
var/min_scan_interval = 1//Minimum and maximum number of procs between a foodscan. Animals will slow down if there's no food around for a while
var/max_scan_interval = 15
var/scan_interval = 5//current scan interval, clamped between min and max
//It gradually increases up to max when its left alone, to save performance
//It will drop back to 1 if it spies any food.
//This short time makes animals more responsive to interactions and more fun to play with
var/seek_speed = 2//How many tiles per second the animal will move towards food
var/seek_move_delay
var/scan_range = 6//How far around the animal will look for food
var/foodtarget = 0
//Used to control how often ian scans for nearby food
/mob/living/simple_animal/proc/beg(var/atom/thing, var/atom/holder)
visible_emote("gazes longingly at [holder]'s [thing]")
/mob/living/simple_animal/New()
..()
seek_move_delay = (1 / seek_speed) / (world.tick_lag / 10)//number of ticks between moves
turns_since_scan = rand(min_scan_interval, max_scan_interval)//Randomise this at the start so animals don't sync up
health = maxHealth
verbs -= /mob/verb/observe
health = maxHealth
if (mob_size)
nutrition_step = mob_size * 0.03 * metabolic_factor
bite_factor = mob_size * 0.3
max_nutrition *= 1 + (nutrition_step*4)//Max nutrition scales faster than costs, so bigger creatures eat less often
reagents = new/datum/reagents(stomach_size_mult*mob_size, src)
else
reagents = new/datum/reagents(20, src)
nutrition = max_nutrition
/mob/living/simple_animal/Move(NewLoc, direct)
. = ..()
if(.)
if(src.nutrition && src.stat != DEAD && hunger_enabled)
src.nutrition -= nutrition_step
/mob/living/simple_animal/Released()
//These will cause mobs to immediately do things when released.
scan_interval = min_scan_interval
turns_since_move = turns_per_move
..()
/mob/living/simple_animal/Login()
if(src && src.client)
src.client.screen = null
..()
/mob/living/simple_animal/updatehealth()
return
/mob/living/simple_animal/examine(mob/user)
..()
if (hunger_enabled)
if (!nutrition)
user << "<span class='danger'>It looks starving!</span>"
else if (nutrition < max_nutrition *0.5)
user << "<span class='notice'>It looks hungry.</span>"
else if ((reagents.total_volume > 0 && nutrition > max_nutrition *0.75) || nutrition > max_nutrition *0.9)
user << "It looks full and contented."
/mob/living/simple_animal/Life()
..()
life_tick++
//Health
updatehealth()
if(stat == DEAD)
if(health > 0)
icon_state = icon_living
dead_mob_list -= src
living_mob_list += src
stat = CONSCIOUS
density = 1
return 0
if(health <= 0)
death()
return
if(health > maxHealth)
health = maxHealth
handle_stunned()
handle_weakened()
handle_paralysed()
update_canmove()
handle_supernatural()
process_food()
handle_foodscanning()
//Movement
turns_since_move++
if(!client && !stop_automated_movement && wander && !anchored)
if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc.
turns_since_move++
if(turns_since_move >= turns_per_move)
if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled
var/moving_to = 0 // otherwise it always picks 4, fuck if I know. Did I mention fuck BYOND
/var/moving_to = 0 // otherwise it always picks 4, fuck if I know. Did I mention fuck BYOND
moving_to = pick(cardinal)
dir = moving_to //How about we turn them the direction they are moving, yay.
Move(get_step(src,moving_to))
@@ -149,6 +209,7 @@
visible_emote("[pick(emote_see)].")
else
audible_emote("[pick(emote_hear)].")
speak_audio()
//Atmos
@@ -194,21 +255,56 @@
//Atmos effect
if(bodytemperature < minbodytemp)
fire_alert = 2
adjustBruteLoss(cold_damage_per_tick)
apply_damage(cold_damage_per_tick, BURN, used_weapon = "Cold Temperature")
else if(bodytemperature > maxbodytemp)
fire_alert = 1
adjustBruteLoss(heat_damage_per_tick)
apply_damage(heat_damage_per_tick, BURN, used_weapon = "High Temperature")
else
fire_alert = 0
if(!atmos_suitable)
adjustBruteLoss(unsuitable_atoms_damage)
apply_damage(unsuitable_atoms_damage, OXY, used_weapon = "Atmosphere")
return 1
/mob/living/simple_animal/proc/handle_supernatural()
if(purge)
purge -= 1
//Simple reagent processing for simple animals
//This allows animals to digest food, and only food
//Most drugs, poisons etc, are designed to work on carbons and affect many values a simple animal doesnt have
/mob/living/simple_animal/proc/process_food()
if (hunger_enabled)
if (nutrition)
nutrition -= nutrition_step//Bigger animals get hungry faster
nutrition = max(0,min(nutrition, max_nutrition))//clamp the value
else
if (prob(3))
src << "You feel hungry..."
if (!reagents || !reagents.total_volume)
return
for(var/datum/reagent/current in reagents.reagent_list)
var/removed = min(current.metabolism*digest_factor, current.volume)
if (istype(current, /datum/reagent/nutriment))//If its food, it feeds us
var/datum/reagent/nutriment/N = current
nutrition += removed*N.nutriment_factor
health = min(health+(removed*N.regen_factor), maxHealth)
current.remove_self(removed)//If its not food, it just does nothing. no fancy effects
/mob/living/simple_animal/proc/can_eat()
if (!hunger_enabled || nutrition > max_nutrition * 0.9)
return 0//full
else if ((nutrition > max_nutrition * 0.8) || health < maxHealth)
return 1//content
else return 2//hungry
/mob/living/simple_animal/gib()
..(icon_gib,1)
@@ -216,18 +312,24 @@
if(act)
..(act, type, desc)
//This is called when an animal 'speaks'. It does nothing here, but descendants should override it to add audio
/mob/living/simple_animal/proc/speak_audio()
return
/mob/living/simple_animal/proc/visible_emote(var/act_desc)
custom_emote(1, act_desc)
/mob/living/simple_animal/proc/audible_emote(var/act_desc)
custom_emote(2, act_desc)
/mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
/*
mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
if(!Proj || Proj.nodamage)
return
adjustBruteLoss(Proj.damage)
return 0
*/
/mob/living/simple_animal/attack_hand(mob/living/carbon/human/M as mob)
..()
@@ -249,6 +351,9 @@
if (!(status_flags & CANPUSH))
return
if (!attempt_grab(M))
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, src)
M.put_in_active_hand(G)
@@ -261,7 +366,7 @@
M.do_attack_animation(src)
if(I_HURT)
adjustBruteLoss(harm_intent_damage)
apply_damage(harm_intent_damage, BRUTE, used_weapon = "Attack by [M.name]")
M.visible_message("\red [M] [response_harm] \the [src]")
M.do_attack_animation(src)
@@ -269,6 +374,7 @@
/mob/living/simple_animal/attackby(var/obj/item/O, var/mob/user)
if(istype(O, /obj/item/stack/medical))
user.changeNext_move(4)
if(stat != DEAD)
var/obj/item/stack/medical/MED = O
if(health < maxHealth)
@@ -282,32 +388,36 @@
M.show_message("<span class='notice'>[user] applies the [MED] on [src].</span>")
else
user << "<span class='notice'>\The [src] is dead, medical items won't bring \him back to life.</span>"
if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
else if(istype(O, /obj/item/weapon/reagent_containers))
..()
else if(meat_type && (stat == DEAD)) //if the animal has a meat, and if it is dead.
if(istype(O, /obj/item/weapon/material/knife) || istype(O, /obj/item/weapon/material/knife/butch))
harvest(user)
else
if(!O.force)
visible_message("<span class='notice'>[user] gently taps [src] with \the [O].</span>")
else
O.attack(src, user, user.zone_sel.selecting)
attacked_with_item(O, user)
/mob/living/simple_animal/hit_with_weapon(obj/item/O, mob/living/user, var/effective_force, var/hit_zone)
//TODO: refactor mob attackby(), attacked_by(), and friends.
/mob/living/simple_animal/proc/attacked_with_item(var/obj/item/O, var/mob/user)
user.changeNext_move(8)
if(!O.force)
visible_message("<span class='notice'>[user] gently taps [src] with \the [O].</span>")
return
visible_message("<span class='danger'>\The [src] has been attacked with \the [O] by [user].</span>")
if(O.force > resistance)
var/damage = O.force
if (O.damtype == HALLOSS)
damage = 0
if(supernatural && istype(O,/obj/item/weapon/nullrod))
damage *= 2
purge = 3
if(O.force <= resistance)
user << "<span class='danger'>This weapon is ineffective, it does no damage.</span>"
return 2
apply_damage(damage, O.damtype, used_weapon = "[O.name]")
else
usr << "<span class='danger>This weapon is ineffective, it does no damage.</span>"
var/damage = O.force
if (O.damtype == HALLOSS)
damage = 0
if(supernatural && istype(O,/obj/item/weapon/nullrod))
damage *= 2
purge = 3
adjustBruteLoss(damage)
return 0
visible_message("<span class='danger'>\The [src] has been attacked with the [O] by [user].</span>")
user.do_attack_animation(src)
/mob/living/simple_animal/movement_delay()
var/tally = 0 //Incase I need to add stuff other than "speed" later
@@ -318,6 +428,9 @@
tally = 1
tally *= purge
if (!nutrition)
tally += 4
return tally+config.animal_delay
/mob/living/simple_animal/Stat()
@@ -326,7 +439,14 @@
if(statpanel("Status") && show_stat_health)
stat(null, "Health: [round((health / maxHealth) * 100)]%")
/mob/living/simple_animal/updatehealth()
..()
if (health <= 0)
death()
/mob/living/simple_animal/death(gibbed, deathmessage = "dies!")
walk_to(src,0)
movement_target = null
icon_state = icon_dead
density = 0
return ..(gibbed,deathmessage)
@@ -336,19 +456,16 @@
flick("flash", flash)
switch (severity)
if (1.0)
adjustBruteLoss(500)
apply_damage(500, BRUTE)
gib()
return
if (2.0)
adjustBruteLoss(60)
apply_damage(60, BRUTE)
if(3.0)
adjustBruteLoss(30)
/mob/living/simple_animal/adjustBruteLoss(damage)
health = Clamp(health - damage, 0, maxHealth)
apply_damage(30, BRUTE)
/mob/living/simple_animal/proc/SA_attackable(target_mob)
if (isliving(target_mob))
@@ -396,6 +513,82 @@
user.visible_message("<span class='danger'>[user] butchers \the [src] messily!</span>")
gib()
//Code to handle finding and nomming nearby food items
/mob/living/simple_animal/proc/handle_foodscanning()
if (client || !hunger_enabled || !autoseek_food)
return 0
//Feeding, chasing food, FOOOOODDDD
if(!stat && !resting && !buckled)
turns_since_scan++
if(turns_since_scan >= scan_interval)
turns_since_scan = 0
if((movement_target) && (!(isturf(movement_target.loc) || ishuman(movement_target.loc))) || (foodtarget && !can_eat() ))
movement_target = null
foodtarget = 0
stop_automated_movement = 0
if( !movement_target || !(movement_target.loc in oview(src, 7)) )
walk_to(src,0)
movement_target = null
foodtarget = 0
stop_automated_movement = 0
if (can_eat())
for(var/obj/item/weapon/reagent_containers/food/snacks/S in oview(src,7))
if(isturf(S.loc) || ishuman(S.loc))
movement_target = S
foodtarget = 1
break
//Look for food in people's hand
if (!movement_target && beg_for_food)
var/obj/item/weapon/reagent_containers/food/snacks/F = null
for(var/mob/living/carbon/human/H in oview(src,scan_range))
if(istype(H.l_hand, /obj/item/weapon/reagent_containers/food/snacks))
F = H.l_hand
if(istype(H.r_hand, /obj/item/weapon/reagent_containers/food/snacks))
F = H.r_hand
if (F)
movement_target = F
foodtarget = 1
break
if(movement_target)
scan_interval = min_scan_interval
stop_automated_movement = 1
if (istype(movement_target.loc, /turf))
walk_to(src,movement_target,0, seek_move_delay)//Stand ontop of food
else
walk_to(src,movement_target.loc,1, seek_move_delay)//Don't stand ontop of people
if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds
if (movement_target.loc.x < src.x)
set_dir(WEST)
else if (movement_target.loc.x > src.x)
set_dir(EAST)
else if (movement_target.loc.y < src.y)
set_dir(SOUTH)
else if (movement_target.loc.y > src.y)
set_dir(NORTH)
else
set_dir(SOUTH)
if(isturf(movement_target.loc) && Adjacent(get_turf(movement_target), src))
UnarmedAttack(movement_target)
if (get_turf(movement_target) == src.loc)
set_dir(pick(1,2,4,8,1,1))//Face a random direction when eating, but mostly upwards
else if(ishuman(movement_target.loc) && Adjacent(src, get_turf(movement_target)) && prob(15))
beg(movement_target, movement_target.loc)
else
scan_interval = max(min_scan_interval, min(scan_interval+1, max_scan_interval))//If nothing is happening, ian's scanning frequency slows down to save processing
//For picking up small animals
/mob/living/simple_animal/MouseDrop(atom/over_object)
if (holder_type)//we need a defined holder type in order for picking up to work
@@ -403,13 +596,13 @@
if(!istype(H) || !Adjacent(H))
return ..()
get_scooped(H)
get_scooped(H, usr)
return
return ..()
/mob/living/simple_animal/handle_fire()
return
/mob/living/simple_animal/update_fire()
return
/mob/living/simple_animal/IgniteMob()
@@ -16,6 +16,8 @@
list(mode_name="lethal", projectile_type=/obj/item/projectile/beam, modifystate="energykill", fire_sound='sound/weapons/Laser.ogg'),
)
var/crit_fail = 0 //Added crit_fail as a local variable
/obj/item/weapon/gun/energy/gun/mounted
name = "mounted energy gun"
self_recharge = 1
@@ -150,7 +150,7 @@
M << "<span class='danger'>[src]'s reactor overloads!</span>"
M << "<span class='warning'>You feel a wave of heat wash over you.</span>"
M.apply_effect(300, IRRADIATE)
crit_fail = 1 //break the gun so it stops recharging
//crit_fail = 1 //break the gun so it stops recharging
processing_objects.Remove(src)
update_icon()
return 0
@@ -397,4 +397,3 @@ obj/item/weapon/gun/energy/staff/focus/attack_self(mob/living/user as mob)
charge_cost = 200
user << "<span class='warning'>The [src.name] will now strike only a single person.</span>"
projectile_type = /obj/item/projectile/forcebolt