-
Notifications
You must be signed in to change notification settings - Fork 550
Adds forgotten beasts #38301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vampirebat74
wants to merge
17
commits into
vgstation-coders:Bleeding-Edge
Choose a base branch
from
vampirebat74:forgotten-beasts
base: Bleeding-Edge
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Adds forgotten beasts #38301
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
456ce80
Adds forgotten beasts
vampirebat74 b83b3cb
radiation and description modifiers
vampirebat74 2dbe071
basic breath attacks
vampirebat74 6b73610
Update code/modules/mob/living/simple_animal/hostile/megabeast.dm
vampirebat74 0ce6170
projectile code fixes
vampirebat74 1620a86
janky breath
vampirebat74 e2e21fb
breath improvements and status effects
vampirebat74 3150d63
Chemical breaths
vampirebat74 f5c76c3
adds the megabeast panel
vampirebat74 05e5d10
Megabeast panel and breath improvements
vampirebat74 d69756c
Megabeast panel improvements + gas attack fixes
vampirebat74 a570f84
linters fix (tested)
vampirebat74 479a9f1
randomized loot and meat drops
vampirebat74 19bfc13
removes a debug item
vampirebat74 b01d3fe
Apply suggestions from code review
vampirebat74 f0882b1
file movement
vampirebat74 52a7d6e
Weighted drop list and randomized sizing
vampirebat74 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 156 additions & 0 deletions
156
code/modules/mob/living/simple_animal/hostile/megabeast.dm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
/obj/effect/landmark/procedural_mobspawn/forgottenbeast | ||
name = "forgotten beast spawner" | ||
desc = "You shouldn't be seeing this" | ||
icon = 'icons/mob/screen1.dmi' | ||
icon_state = "x2" | ||
var/mob/living/simple_animal/hostile/mobtype | ||
|
||
/obj/effect/landmark/procedural_mobspawn/forgottenbeast/New() | ||
SpawnMob(mobtype) | ||
|
||
/obj/effect/landmark/procedural_mobspawn/forgottenbeast/proc/SpawnMob() | ||
new /mob/living/simple_animal/hostile/forgotten_beast(get_turf(src), new /datum/procedural_mobspawn(mobtype)) | ||
qdel(src) | ||
|
||
/* | ||
//Megabeast Template | ||
//Basic beast template. | ||
//Arguments: loc for spawn location | ||
//(optional) add_template for a pre-chosen procgen datum to template off of. If none is provided, it will pick one at random from the existing list. If none exist, it will make one. | ||
// | ||
//refer to procedural_mobspawn for the datums | ||
*/ | ||
/mob/living/simple_animal/hostile/forgotten_beast | ||
name = "Forgotten Beast" | ||
desc = "Some indescribable horror." | ||
health = 1000 | ||
maxHealth = 1000 | ||
icon = 'icons/mob/animal.dmi' | ||
icon_state = "otherthing" | ||
icon_dead = "otherthing-dead" | ||
attack_sound = 'sound/weapons/heavysmash.ogg' | ||
faction = "megabeast" | ||
min_oxy = 0 | ||
max_oxy = 0 | ||
min_tox = 0 | ||
max_tox = 0 | ||
min_co2 = 0 | ||
max_co2 = 0 | ||
min_n2 = 0 | ||
max_n2 = 0 | ||
environment_smash_flags = SMASH_LIGHT_STRUCTURES | SMASH_CONTAINERS | SMASH_WALLS | ||
size = SIZE_HUGE | ||
a_intent = I_HURT | ||
var/picked | ||
var/mob/living/simple_animal/hostile/mymob | ||
var/list/mob_types | ||
var/list/breath_types = list() | ||
var/datum/reagent/vapors | ||
var/radioactive | ||
var/pulse_cooldown = 0 | ||
var/special_cooldown | ||
var/breath_damage = 10 | ||
var/breath_damage_type = BRUTE | ||
var/datum/custom_breath/mybreath | ||
var/datum/procedural_mobspawn/template | ||
var/obj/loot | ||
var/loot_count | ||
|
||
/mob/living/simple_animal/hostile/forgotten_beast/Life() | ||
..() | ||
if(radioactive) | ||
if(world.time > pulse_cooldown +20 SECONDS) | ||
rad_blast() | ||
if(vapors) | ||
if(world.time > pulse_cooldown +60 SECONDS) | ||
GasAttack() | ||
|
||
/mob/living/simple_animal/hostile/forgotten_beast/death(var/gibbed = FALSE) | ||
if(!gibbed) | ||
gib() | ||
return | ||
for(var/i = loot_count; i > 0) | ||
new loot(get_turf(src)) | ||
--i | ||
new /obj/effect/gibspawner/generic(src.loc) | ||
qdel(src) | ||
|
||
/mob/living/simple_animal/hostile/forgotten_beast/OpenFire(target) | ||
if(!mybreath) | ||
return ..() | ||
if(prob(70)) | ||
BreathAttack(target) | ||
return | ||
if(!projectiletype) | ||
return | ||
..() | ||
|
||
/mob/living/simple_animal/hostile/forgotten_beast/New(loc, var/datum/procedural_mobspawn/add_template) | ||
appearance_flags |= PIXEL_SCALE | ||
if(!add_template) //no template provided | ||
if(!procgen_mob_datums.len) //if no pre-generated templates available... | ||
add_template = new /datum/procedural_mobspawn/ //generating a new one will add it to the list automatically | ||
else | ||
add_template = pick(procgen_mob_datums) | ||
template = add_template | ||
meat_type = pick(typesof(/obj/item/weapon/reagent_containers/food/snacks/meat)) | ||
|
||
name = template.name | ||
health = template.health | ||
maxHealth = template.maxHealth | ||
desc = template.desc | ||
icon = template.icon | ||
icon_state = template.icon_state | ||
icon_dead = template.icon_dead | ||
pixel_x = template.pixel_x | ||
pixel_y = template.pixel_y | ||
melee_damage_lower = template.melee_damage_lower | ||
melee_damage_upper = template.melee_damage_upper | ||
mybreath = template.mybreath | ||
ranged = template.ranged | ||
rapid = template.rapid | ||
projectiletype = template.projectiletype | ||
move_to_delay = template.move_to_delay | ||
color = template.color | ||
transform = template.size_matrix | ||
radioactive = template.radioactive | ||
vapors = template.vapors | ||
loot = template.randomloot[1] | ||
loot_count = template.randomloot[2] | ||
..() | ||
|
||
/mob/living/simple_animal/hostile/forgotten_beast/proc/BreathAttack(atom/A = target) | ||
if(world.time < (special_cooldown + 10 SECONDS)) | ||
return | ||
var/obj/item/projectile/custom_breath/thebreath = new /obj/item/projectile/custom_breath(src) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a weakref, otherwise you're going to get a hard del when the projectile deletes itself and has to remove this reference. |
||
thebreath.name = mybreath.name//find a better way to do this | ||
thebreath.damage = mybreath.damage | ||
thebreath.color = mybreath.color | ||
thebreath.damage_type = mybreath.damage_type | ||
thebreath.pressure = mybreath.pressure | ||
thebreath.temperature = mybreath.temperature | ||
thebreath.special = mybreath.special | ||
thebreath.reagent_type = mybreath.reagent_type | ||
generic_projectile_fire(get_ranged_target_turf(src, dir, 10), src, thebreath, 'sound/weapons/flamethrower.ogg', src) | ||
special_cooldown = world.time | ||
|
||
/mob/living/simple_animal/hostile/forgotten_beast/proc/GasAttack() | ||
playsound(get_turf(src), 'sound/effects/smoke.ogg', 50, FALSE, 8) | ||
// Create the reagents to put into the air | ||
reagents.add_reagent(vapors.id, 100) | ||
var/datum/chemical_reaction/chemsmoke/CS = new() | ||
CS.on_reaction(src.reagents) | ||
pulse_cooldown = world.time | ||
|
||
/mob/living/simple_animal/hostile/forgotten_beast/proc/rad_blast()//copied from glowing ones, does not require radiation | ||
if(prob(30)) | ||
visible_message("<span class = 'blob'>\The [src] glows with a brilliant light!</span>") | ||
set_light(vision_range/2, vision_range, "#a1d68b") | ||
spawn(1 SECONDS) | ||
emitted_harvestable_radiation(get_turf(src), rand(250, 500), range = 7) | ||
|
||
for(var/mob/living/carbon/human/H in view(src, vision_range)) | ||
H.apply_radiation(15, RAD_EXTERNAL) | ||
pulse_cooldown = world.time | ||
spawn(3 SECONDS) | ||
set_light(1, 2, "#5dca31") |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the proper recursion, you should call this proc at the end. It'll handle the cleanup of things like list references (hard dels), possessed clients, etc. gib() will call its own gibs. If you want more, you can technically use the gibs(loc) proc (which is just the above spawner, but more future proofed in case we change gibs in the future)
Flow is
beast dies -> death(0) called -> gib() called -> gib calls death(1) -> skips first if, spawns loot, with suggested change enters parent procs to handle weird situations -> finishes -> returns to gib proc -> gib removes the mobs from the death list -> gib qdels them -> gib returns to death(0) -> death(0) returns