Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fixes two bugs
  • Loading branch information
spookydonut authored and Rohesie committed Nov 19, 2018
1 parent 95f299d commit a4e439c
Show file tree
Hide file tree
Showing 59 changed files with 3,009 additions and 1,672 deletions.
1 change: 0 additions & 1 deletion ColonialMarinesALPHA.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,6 @@
#include "code\modules\mob\living\carbon\xenomorph\Xenomorph.dm"
#include "code\modules\mob\living\carbon\xenomorph\XenoProcs.dm"
#include "code\modules\mob\living\carbon\xenomorph\XenoUpgrade.dm"
#include "code\modules\mob\living\carbon\xenomorph\XenoUpgrades.dm"
#include "code\modules\mob\living\carbon\xenomorph\Castes\Boiler.dm"
#include "code\modules\mob\living\carbon\xenomorph\Castes\Carrier.dm"
#include "code\modules\mob\living\carbon\xenomorph\Castes\Crusher.dm"
Expand Down
18 changes: 14 additions & 4 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -493,14 +493,24 @@ var/list/global_mutations = list() // list of hidden mutation things
//defender defines

#define DEFENDER_HEADBUTT_COST 20
#define DEFENDER_HEADBUTT_COOLDOWN 4 SECONDS
#define DEFENDER_TAILSWIPE_COST 30
#define DEFENDER_TAILSWIPE_COOLDOWN 12 SECONDS
#define DEFENDER_FORTIFY_COOLDOWN 1 SECOND
#define DEFENDER_CREST_DEFENSE_COOLDOWN 1 SECOND

//carrier defines

#define CARRIER_SPAWN_HUGGER_COST 100
#define CARRIER_HUGGER_THROW_SPEED 2
#define CARRIER_HUGGER_THROW_DISTANCE 5

#define CANNOT_HOLD_EGGS 0
#define CAN_HOLD_TWO_HANDS 1
#define CAN_HOLD_ONE_HAND 2

#define CASTE_CAN_HOLD_FACEHUGGERS (1<<0)
#define CASTE_CAN_VENT_CRAWL (1<<1)
#define CASTE_CAN_BE_QUEEN_HEALED (1<<2)
#define CASTE_CAN_BE_GIVEN_PLASMA (1<<3)
#define CASTE_INNATE_HEALING (1<<4)
#define CASTE_FIRE_IMMUNE (1<<5)
#define CASTE_EVOLUTION_ALLOWED (1<<6)
#define CASTE_IS_INTELLIGENT (1<<7)
#define CASTE_IS_ROBOTIC (1<<8)
10 changes: 10 additions & 0 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ var/global/list/all_languages[0]
var/global/list/language_keys[0] //table of say codes for all languages
var/global/list/synth_types = list("Synthetic","Early Synthetic")

var/global/list/xeno_caste_datums = list()

// Posters
var/global/list/datum/poster/poster_designs = subtypesof(/datum/poster)
//Preferences stuff
Expand Down Expand Up @@ -178,6 +180,14 @@ var/global/list/moth_wings_list = list()
for(var/t in subtypesof(/datum/ammo) - blacklist)
var/datum/ammo/A = new t
ammo_list[A.type] = A

for(var/X in subtypesof(/datum/xeno_caste))
var/datum/xeno_caste/C = new X
if(!(C.caste_type_path in xeno_caste_datums))
xeno_caste_datums[C.caste_type_path] = list(1,2,3,4)
var/upgrade_level = CLAMP(C.upgrade + 1, 1, 4)
xeno_caste_datums[C.caste_type_path][upgrade_level] = C

return 1

/* // Uncomment to debug chemical reaction list.
Expand Down
4 changes: 3 additions & 1 deletion code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,13 @@ var/datum/mob_hud/huds = list(
//xeno status HUD

/mob/living/carbon/Xenomorph/proc/hud_set_plasma()
if(!xeno_caste) // usually happens because hud ticks before New() finishes.
return
var/image/holder = hud_list[PLASMA_HUD]
if(stat == DEAD)
holder.icon_state = "plasma0"
else
var/amount = round(plasma_stored * 100 / plasma_max, 10)
var/amount = round(plasma_stored * 100 / xeno_caste.plasma_max, 10)
holder.icon_state = "plasma[amount]"


Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/colonialmarines/whiskey_outpost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@
picked = pick(xeno_spawn_loc)
var/mob/living/carbon/Xenomorph/X = new path(picked)
X.away_timer = 300 //So ghosts can join instantly
X.plasma_stored = X.plasma_max
X.plasma_stored = X.xeno_caste.plasma_max
X.flags_pass = 0 // Runners cannot pass trough tables

//X.a_intent = "harm" This caused problems
Expand All @@ -973,7 +973,7 @@
picked = pick(xeno_spawn_loc)
var/mob/living/carbon/Xenomorph/X = new path(picked)
X.away_timer = 300 //So ghosts can join instantly
X.plasma_stored = X.plasma_max
X.plasma_stored = X.xeno_caste.plasma_max
X.flags_pass = 0 // Runners cannot pass trough tables

//X.a_intent = "harm" This caused problems
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/door_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
return src.attack_hand(user)

/obj/machinery/door_control/attack_alien(mob/living/carbon/Xenomorph/M)
if(M.is_intelligent && normaldoorcontrol == CONTROL_DROPSHIP)
if(M.xeno_caste.caste_flags & CASTE_IS_INTELLIGENT && normaldoorcontrol == CONTROL_DROPSHIP)
var/shuttle_tag
switch(id)
if("sh_dropship1")
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/groundmap_geothermal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
else
M.animation_attack_on(src)
M.visible_message("[M] slashes away at [src]!","You slash and claw at the bright light!", null, null, 5)
health = max(health - rand(M.melee_damage_lower, M.melee_damage_upper), 0)
health = max(health - rand(M.xeno_caste.melee_damage_lower, M.xeno_caste.melee_damage_upper), 0)
if(!health)
playsound(src, "shatter", 70, 1)
damaged = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/vending/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@

if(M.a_intent == "hurt")
M.animation_attack_on(src)
if(prob(M.melee_damage_lower))
if(prob(M.xeno_caste.melee_damage_lower))
playsound(loc, 'sound/effects/metalhit.ogg', 25, 1)
M.visible_message("<span class='danger'>\The [M] smashes \the [src] beyond recognition!</span>", \
"<span class='danger'>You enter a frenzy and smash \the [src] apart!</span>", null, 5)
Expand Down
2 changes: 1 addition & 1 deletion code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
log_message("Attack by claw. Attacker - [M].", color="red")

if(!prob(deflect_chance))
take_damage((rand(M.melee_damage_lower, M.melee_damage_upper)/2))
take_damage((rand(M.xeno_caste.melee_damage_lower, M.xeno_caste.melee_damage_upper)/2))
check_for_internal_damage(list(MECHA_INT_CONTROL_LOST))
playsound(loc, "alien_claw_metal", 25, 1)
M.visible_message("<span class='danger'>[M] slashes [src]'s armor!</span>", \
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/barricade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@

/obj/structure/barricade/attack_alien(mob/living/carbon/Xenomorph/M)
M.animation_attack_on(src)
health -= rand(M.melee_damage_lower, M.melee_damage_upper)
health -= rand(M.xeno_caste.melee_damage_lower, M.xeno_caste.melee_damage_upper)
if(barricade_hitsound)
playsound(src, barricade_hitsound, 25, 1)
if(health <= 0)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/girders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
return FALSE
else
M.animation_attack_on(src)
health -= round(rand(M.melee_damage_lower, M.melee_damage_upper) / 2)
health -= round(rand(M.xeno_caste.melee_damage_lower, M.xeno_caste.melee_damage_upper) / 2)
if(health <= 0)
M.visible_message("<span class='danger'>\The [M] smashes \the [src] apart!</span>", \
"<span class='danger'>You slice \the [src] apart!</span>", null, 5)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
playsound(src, 'sound/effects/woodhit.ogg', 25, 1)
else
playsound(src, 'sound/effects/metalhit.ogg', 25, 1)
health -= rand(M.melee_damage_lower, M.melee_damage_upper)
health -= rand(M.xeno_caste.melee_damage_lower, M.xeno_caste.melee_damage_upper)
if(health <= 0)
M.visible_message("<span class='danger'>\The [M] slices [src] apart!</span>", \
"<span class='danger'>You slice [src] apart!</span>", null, 5)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"<span class='warning'>You creepily tap on [src].</span>", \
"<span class='warning'>You hear a glass tapping sound.</span>", 5)
else
attack_generic(M, M.melee_damage_lower)
attack_generic(M, M.xeno_caste.melee_damage_lower)

/obj/structure/window/attack_hand(mob/user as mob)
if(HULK in user.mutations)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/cm_aliens/Ovipositor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
M.start_pulling(src)

if("hurt")
var/damage = (rand(M.melee_damage_lower, M.melee_damage_upper) + 3)
var/damage = (rand(M.xeno_caste.melee_damage_lower, M.xeno_caste.melee_damage_upper) + 3)
M.visible_message("<span class='danger'>\The [M] bites [src]!</span>", \
"<span class='danger'>You bite [src]!</span>")
health -= damage
Expand Down
16 changes: 7 additions & 9 deletions code/modules/cm_aliens/XenoStructures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,7 @@

/obj/effect/alien/resin/trap/attack_alien(mob/living/carbon/Xenomorph/M)
if(M.a_intent != "hurt")
var/list/allowed_castes = list("Queen","Drone","Hivelord","Carrier")
if(allowed_castes.Find(M.caste))
if(M.xeno_caste.caste_flags & CASTE_CAN_HOLD_FACEHUGGERS)
if(!hugger)
to_chat(M, "<span class='warning'>[src] is empty.</span>")
else
Expand Down Expand Up @@ -484,13 +483,12 @@

switch(status)
if(BURST, DESTROYED)
switch(M.caste)
if("Queen","Drone","Hivelord","Carrier")
M.visible_message("<span class='xenonotice'>\The [M] clears the hatched egg.</span>", \
"<span class='xenonotice'>You clear the hatched egg.</span>")
playsound(src.loc, "alien_resin_break", 25)
M.plasma_stored++
cdel(src)
if(M.xeno_caste.can_hold_eggs)
M.visible_message("<span class='xenonotice'>\The [M] clears the hatched egg.</span>", \
"<span class='xenonotice'>You clear the hatched egg.</span>")
playsound(src.loc, "alien_resin_break", 25)
M.plasma_stored++
cdel(src)
if(GROWING)
to_chat(M, "<span class='xenowarning'>The child is not developed yet.</span>")
if(GROWN)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/cm_marines/equipment/sentries.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
M.animation_attack_on(src)
M.flick_attack_overlay(src, "slash")
playsound(loc, "alien_claw_metal", 25)
update_health(rand(M.melee_damage_lower,M.melee_damage_upper))
update_health(rand(M.xeno_caste.melee_damage_lower,M.xeno_caste.melee_damage_upper))

/obj/machinery/marine_turret_frame/examine(mob/user as mob)
..()
Expand Down Expand Up @@ -882,7 +882,7 @@
if(prob(10))
if(!locate(/obj/effect/decal/cleanable/blood/oil) in loc)
new /obj/effect/decal/cleanable/blood/oil(loc)
update_health(rand(M.melee_damage_lower,M.melee_damage_upper))
update_health(rand(M.xeno_caste.melee_damage_lower,M.xeno_caste.melee_damage_upper))

/obj/machinery/marine_turret/bullet_act(var/obj/item/projectile/Proj) //Nope.
visible_message("[src] is hit by the [Proj.name]!")
Expand Down
4 changes: 2 additions & 2 deletions code/modules/cm_marines/smartgun_mount.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
M.animation_attack_on(src)
M.flick_attack_overlay(src, "slash")
playsound(loc, "alien_claw_metal", 25)
update_health(rand(M.melee_damage_lower,M.melee_damage_upper))
update_health(rand(M.xeno_caste.melee_damage_lower,M.xeno_caste.melee_damage_upper))


/obj/machinery/m56d_post/MouseDrop(over_object, src_location, over_location) //Drag the tripod onto you to fold it.
Expand Down Expand Up @@ -396,7 +396,7 @@
M.animation_attack_on(src)
M.flick_attack_overlay(src, "slash")
playsound(loc, "alien_claw_metal", 25)
update_health(rand(M.melee_damage_lower,M.melee_damage_upper))
update_health(rand(M.xeno_caste.melee_damage_lower,M.xeno_caste.melee_damage_upper))

/obj/machinery/m56d_hmg/proc/load_into_chamber()
if(in_chamber) return 1 //Already set!
Expand Down
Loading

0 comments on commit a4e439c

Please sign in to comment.