Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moths #34243

Closed
wants to merge 1 commit into from
Closed

Moths #34243

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/DNA.dm
Expand Up @@ -123,6 +123,7 @@
#define SPECIES_INORGANIC 32
#define SPECIES_UNDEAD 33
#define SPECIES_ROBOTIC 34
#define NOEYES 35

#define ORGAN_SLOT_BRAIN "brain"
#define ORGAN_SLOT_APPENDIX "appendix"
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/mobs.dm
Expand Up @@ -202,4 +202,4 @@

// AI Toggles
#define AI_CAMERA_LUMINOSITY 5
#define AI_VOX // Comment out if you don't want VOX to be enabled and have players download the voice sounds.
#define AI_VOX // Comment out if you don't want VOX to be enabled and have players download the voice sounds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

There is nothing in this file in this commit besides removing the line ending.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there WAS something in this file, i removed it, now git is being a shit

14 changes: 11 additions & 3 deletions code/__HELPERS/mobs.dm
Expand Up @@ -68,9 +68,11 @@
init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, GLOB.body_markings_list)
if(!GLOB.wings_list.len)
init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, GLOB.wings_list)
if(!GLOB.moth_wings_list.len)
init_sprite_accessory_subtypes(/datum/sprite_accessory/moth_wings, GLOB.moth_wings_list)

//For now we will always return none for tail_human and ears.
return(list("mcolor" = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F"), "tail_lizard" = pick(GLOB.tails_list_lizard), "tail_human" = "None", "wings" = "None", "snout" = pick(GLOB.snouts_list), "horns" = pick(GLOB.horns_list), "ears" = "None", "frills" = pick(GLOB.frills_list), "spines" = pick(GLOB.spines_list), "body_markings" = pick(GLOB.body_markings_list), "legs" = "Normal Legs"))
return(list("mcolor" = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F"), "tail_lizard" = pick(GLOB.tails_list_lizard), "tail_human" = "None", "wings" = "None", "snout" = pick(GLOB.snouts_list), "horns" = pick(GLOB.horns_list), "ears" = "None", "frills" = pick(GLOB.frills_list), "spines" = pick(GLOB.spines_list), "body_markings" = pick(GLOB.body_markings_list), "legs" = "Normal Legs", "moth_wings" = pick(GLOB.moth_wings_list)))

/proc/random_hair_style(gender)
switch(gender)
Expand Down Expand Up @@ -114,6 +116,13 @@
if(i != attempts_to_find_unique_name && !findname(.))
break

/proc/random_unique_moth_name(attempts_to_find_unique_name=10)
for(var/i=1, i<=attempts_to_find_unique_name, i++)
. = capitalize(moth_name())

if(i != attempts_to_find_unique_name && !findname(.))
break

/proc/random_skin_tone()
return pick(GLOB.skin_tones)

Expand Down Expand Up @@ -486,5 +495,4 @@ Proc for attack log creation, because really why not
log_ooc(logmessage)
else
warning("Invalid speech logging type detected. [logtype]. Defaulting to say")
log_say(logmessage)

log_say(logmessage)
3 changes: 3 additions & 0 deletions code/__HELPERS/names.dm
Expand Up @@ -241,3 +241,6 @@ GLOBAL_VAR(syndicate_code_response) //Code response for traitors.
. += "."
else
. += ", "

/proc/moth_name()
return "[pick(GLOB.moth_names)]"
2 changes: 2 additions & 0 deletions code/_globalvars/lists/flavor_misc.dm
Expand Up @@ -35,6 +35,8 @@ GLOBAL_LIST_EMPTY(wings_list)
GLOBAL_LIST_EMPTY(wings_open_list)
GLOBAL_LIST_EMPTY(r_wings_list)

GLOBAL_LIST_EMPTY(moth_wings_list)

GLOBAL_LIST_INIT(ghost_forms_with_directions_list, list("ghost")) //stores the ghost forms that support directional sprites
GLOBAL_LIST_INIT(ghost_forms_with_accessories_list, list("ghost")) //stores the ghost forms that support hair and other such things

Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/lists/names.dm
Expand Up @@ -18,6 +18,7 @@ GLOBAL_LIST_INIT(posibrain_names, world.file2list("strings/names/posibrain.txt")
GLOBAL_LIST_INIT(nightmare_names, world.file2list("strings/names/nightmare.txt"))
GLOBAL_LIST_INIT(megacarp_first_names, world.file2list("strings/names/megacarp1.txt"))
GLOBAL_LIST_INIT(megacarp_last_names, world.file2list("strings/names/megacarp2.txt"))
GLOBAL_LIST_INIT(moth_names, world.file2list("strings/names/moth.txt"))

GLOBAL_LIST_INIT(verbs, world.file2list("strings/names/verbs.txt"))
GLOBAL_LIST_INIT(ing_verbs, world.file2list("strings/names/ing_verbs.txt"))
Expand Down
18 changes: 17 additions & 1 deletion code/modules/client/preferences.dm
Expand Up @@ -68,7 +68,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/skin_tone = "caucasian1" //Skin color
var/eye_color = "000" //Eye color
var/datum/species/pref_species = new /datum/species/human() //Mutant race
var/list/features = list("mcolor" = "FFF", "tail_lizard" = "Smooth", "tail_human" = "None", "snout" = "Round", "horns" = "None", "ears" = "None", "wings" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None", "legs" = "Normal Legs")
var/list/features = list("mcolor" = "FFF", "tail_lizard" = "Smooth", "tail_human" = "None", "snout" = "Round", "horns" = "None", "ears" = "None", "wings" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None", "legs" = "Normal Legs", "moth_wings" = "Plain")

var/list/custom_names = list("human", "clown", "mime", "ai", "cyborg", "religion", "deity")
var/prefered_security_department = SEC_DEPT_RANDOM
Expand Down Expand Up @@ -270,6 +270,16 @@ GLOBAL_LIST_EMPTY(preferences_datums)

dat += "</td>"

if("moth_wings" in pref_species.mutant_bodyparts)

dat += "<td valign='top' width='7%'>"

dat += "<h3>Moth wings</h3>"

dat += "<a href='?_src_=prefs;preference=moth_wings;task=input'>[features["moth_wings"]]</a><BR>"

dat += "</td>"

if("tail_lizard" in pref_species.mutant_bodyparts)
dat += "<td valign='top' width='7%'>"

Expand Down Expand Up @@ -984,6 +994,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
else
to_chat(user, "<span class='danger'>Invalid color. Your color is not bright enough.</span>")

if("moth_wings")
var/new_moth_wings
new_moth_wings = input(user, "Choose your character's wings:", "Character Preference") as null|anything in GLOB.moth_wings_list
if(new_moth_wings)
features["moth_wings"] = new_moth_wings

if("tail_lizard")
var/new_tail
new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_lizard
Expand Down
5 changes: 4 additions & 1 deletion code/modules/client/preferences_savefile.dm
Expand Up @@ -162,7 +162,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["enable_tips"] >> enable_tips
S["tip_delay"] >> tip_delay
S["pda_style"] >> pda_style
S["pda_color"] >> pda_color
S["pda_color"] >> pda_color

//try to fix any outdated data if necessary
if(needs_update >= 0)
Expand Down Expand Up @@ -284,6 +284,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["uplink_loc"] >> uplink_spawn_loc
S["feature_mcolor"] >> features["mcolor"]
S["feature_lizard_tail"] >> features["tail_lizard"]
S["feature_moth_wings"] >> features["moth_wings"]
S["feature_lizard_snout"] >> features["snout"]
S["feature_lizard_horns"] >> features["horns"]
S["feature_lizard_frills"] >> features["frills"]
Expand Down Expand Up @@ -359,6 +360,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
features["spines"] = sanitize_inlist(features["spines"], GLOB.spines_list)
features["body_markings"] = sanitize_inlist(features["body_markings"], GLOB.body_markings_list)
features["feature_lizard_legs"] = sanitize_inlist(features["legs"], GLOB.legs_list, "Normal Legs")
features["moth_wings"] = sanitize_inlist(features["moth_wings"], GLOB.moth_wings_list, "Plain")

joblessrole = sanitize_integer(joblessrole, 1, 3, initial(joblessrole))
job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high))
Expand Down Expand Up @@ -411,6 +413,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["feature_lizard_frills"] , features["frills"])
WRITE_FILE(S["feature_lizard_spines"] , features["spines"])
WRITE_FILE(S["feature_lizard_body_markings"] , features["body_markings"])
WRITE_FILE(S["feature_moth_wings"] , features["moth_wings"])
WRITE_FILE(S["feature_lizard_legs"] , features["legs"])
WRITE_FILE(S["human_name"] , custom_names["human"])
WRITE_FILE(S["clown_name"] , custom_names["clown"])
Expand Down
5 changes: 5 additions & 0 deletions code/modules/food_and_drinks/food/snacks/meat.dm
Expand Up @@ -125,6 +125,11 @@
tastes = list("brains" = 1, "meat" = 1)
foodtype = RAW | MEAT | TOXIC

/obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/moth
icon_state = "mothmeat"
desc = "Nothing says 'I hate insects' like eating the flesh from one! Oh wait..."
filling_color = "#BF896B"
tastes = list("insects" = 1)


////////////////////////////////////// OTHER MEATS ////////////////////////////////////////////////////////
Expand Down
11 changes: 11 additions & 0 deletions code/modules/language/moth.dm
@@ -0,0 +1,11 @@
/datum/language/moth
name = "Mothish"
desc = "The common language of moths, composed of various noises made of wing fluttering and clicks."
speech_verb = "flutters"
ask_verb = "clicks"
exclaim_verb = "buzzes"
key = "m"
space_chance = 90
syllables = list("bz", "ba", "mah", "fa", "ki", "nr")
default_priority = 90
icon_state = "mothl"
72 changes: 72 additions & 0 deletions code/modules/mob/dead/new_player/sprite_accessories.dm
Expand Up @@ -1401,3 +1401,75 @@

/datum/sprite_accessory/legs/digitigrade_lizard
name = "Digitigrade Legs"

////////////////////
// MOTH BULLSHIT ///
////////////////////

/datum/sprite_accessory/moth_wings
icon = 'icons/mob/wings.dmi'
color_src = null

/datum/sprite_accessory/moth_wings/plain
name = "Plain"
icon_state = "plain"

/datum/sprite_accessory/moth_wings/monarch
name = "Monarch"
icon_state = "monarch"

/datum/sprite_accessory/moth_wings/luna
name = "Luna"
icon_state = "luna"

/datum/sprite_accessory/moth_wings/atlas
name = "Atlas"
icon_state = "atlas"

/datum/sprite_accessory/moth_wings/redish
name = "Redish"
icon_state = "redish"

/datum/sprite_accessory/moth_wings/royal
name = "Royal"
icon_state = "royal"

/datum/sprite_accessory/moth_wings/gothic
name = "Gothic"
icon_state = "gothic"

/datum/sprite_accessory/moth_wings/lovers
name = "Lovers"
icon_state = "lovers"

/datum/sprite_accessory/moth_wings/whitefly
name = "White fly"
icon_state = "whitefly"

/datum/sprite_accessory/moth_wings/punished
name = "Punished"
icon_state = "punished"

/datum/sprite_accessory/moth_wings/firewatch
name = "Fire watch"
icon_state = "firewatch"

/datum/sprite_accessory/moth_wings/deathhead
name = "Death head"
icon_state = "deathhead"

/datum/sprite_accessory/moth_wings/poison
name = "Poison"
icon_state = "poison"

/datum/sprite_accessory/moth_wings/ragged
name = "Ragged"
icon_state = "ragged"

/datum/sprite_accessory/moth_wings/moonfly
name = "Moon Fly"
icon_state = "moonfly"

/datum/sprite_accessory/moth_wings/snow
name = "Snow"
icon_state = "snow"
7 changes: 5 additions & 2 deletions code/modules/mob/living/carbon/human/human.dm
Expand Up @@ -25,9 +25,9 @@
create_internal_organs() //most of it is done in set_species now, this is only for parent call

handcrafting = new()

. = ..()

AddComponent(/datum/component/redirect, list(COMSIG_COMPONENT_CLEAN_ACT), CALLBACK(src, .proc/clean_blood))

/mob/living/carbon/human/OpenCraftingMenu()
Expand Down Expand Up @@ -1028,3 +1028,6 @@

/mob/living/carbon/human/species/zombie/krokodil_addict
race = /datum/species/krokodil_addict

/mob/living/carbon/human/species/moth
race = /datum/species/moth
28 changes: 15 additions & 13 deletions code/modules/mob/living/carbon/human/species.dm
Expand Up @@ -76,7 +76,6 @@ GLOBAL_LIST_EMPTY(roundstart_races)
var/obj/item/organ/liver/mutantliver
var/obj/item/organ/stomach/mutantstomach
var/override_float = FALSE

///////////
// PROCS //
///////////
Expand Down Expand Up @@ -451,18 +450,19 @@ GLOBAL_LIST_EMPTY(roundstart_races)
standing += lip_overlay

// eyes
var/has_eyes = H.getorganslot(ORGAN_SLOT_EYES)
var/mutable_appearance/eye_overlay
if(!has_eyes)
eye_overlay = mutable_appearance('icons/mob/human_face.dmi', "eyes_missing", -BODY_LAYER)
else
eye_overlay = mutable_appearance('icons/mob/human_face.dmi', "eyes", -BODY_LAYER)
if((EYECOLOR in species_traits) && has_eyes)
eye_overlay.color = "#" + H.eye_color
if(OFFSET_FACE in H.dna.species.offset_features)
eye_overlay.pixel_x += H.dna.species.offset_features[OFFSET_FACE][1]
eye_overlay.pixel_y += H.dna.species.offset_features[OFFSET_FACE][2]
standing += eye_overlay
if(!(NOEYES in species_traits))
var/has_eyes = H.getorganslot(ORGAN_SLOT_EYES)
var/mutable_appearance/eye_overlay
if(!has_eyes)
eye_overlay = mutable_appearance('icons/mob/human_face.dmi', "eyes_missing", -BODY_LAYER)
else
eye_overlay = mutable_appearance('icons/mob/human_face.dmi', "eyes", -BODY_LAYER)
if((EYECOLOR in species_traits) && has_eyes)
eye_overlay.color = "#" + H.eye_color
if(OFFSET_FACE in H.dna.species.offset_features)
eye_overlay.pixel_x += H.dna.species.offset_features[OFFSET_FACE][1]
eye_overlay.pixel_y += H.dna.species.offset_features[OFFSET_FACE][2]
standing += eye_overlay

//Underwear, Undershirts & Socks
if(!(NO_UNDERWEAR in species_traits))
Expand Down Expand Up @@ -624,6 +624,8 @@ GLOBAL_LIST_EMPTY(roundstart_races)
S = GLOB.wings_open_list[H.dna.features["wings"]]
if("legs")
S = GLOB.legs_list[H.dna.features["legs"]]
if("moth_wings")
S = GLOB.moth_wings_list[H.dna.features["moth_wings"]]

if(!S || S.icon_state == "none")
continue
Expand Down
Expand Up @@ -2,7 +2,7 @@
name = "Flyperson"
id = "fly"
say_mod = "buzzes"
species_traits = list(SPECIES_ORGANIC)
species_traits = list(SPECIES_ORGANIC, NOEYES)
mutanttongue = /obj/item/organ/tongue/fly
mutantliver = /obj/item/organ/liver/fly
mutantstomach = /obj/item/organ/stomach/fly
Expand Down
72 changes: 72 additions & 0 deletions code/modules/mob/living/carbon/human/species_types/moth.dm
@@ -0,0 +1,72 @@
/datum/species/moth
// Shitty moths, why do we need them dammit
name = "Mothmen"
id = "moth"
say_mod = "flutters"
default_color = "00FF00"
species_traits = list(LIPS, SPECIES_ORGANIC, NOEYES)
mutant_bodyparts = list("moth_wings")
default_features = list("moth_wings" = "Plain")
attack_verb = "slash"
attack_sound = 'sound/weapons/slash.ogg'
miss_sound = 'sound/weapons/slashmiss.ogg'
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/moth
liked_food = VEGETABLES | DAIRY
disliked_food = FRUIT | GROSS
toxic_food = MEAT | RAW

/datum/species/moth/on_species_gain(mob/living/carbon/C)
. = ..()
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(!H.dna.features["moth_wings"])
H.dna.features["moth_wings"] = "[(H.client && H.client.prefs && LAZYLEN(H.client.prefs.features) && H.client.prefs.features["moth_wings"]) ? H.client.prefs.features["moth_wings"] : "Plain"]"
handle_mutant_bodyparts(H)
C.grant_language(/datum/language/moth)

/datum/species/moth/on_species_loss(mob/living/carbon/C)
. = ..()
C.remove_language(/datum/language/moth)

/datum/species/moth/random_name(gender,unique,lastname)
if(unique)
return random_unique_moth_name(gender)

var/randname = moth_name(gender)

if(lastname)
randname += " [lastname]"

return randname

/datum/species/moth/qualifies_for_rank(rank, list/features)
if(CONFIG_GET(flag/enforce_human_authority) && (rank in GLOB.command_positions))
return FALSE
return TRUE

/datum/species/moth/handle_fire(mob/living/carbon/human/H, no_protection = FALSE)
..()
if(H.dna.features["moth_wings"] != "Punished")
if(H.bodytemperature >= 800)//If you reach this, you're in the red zone with the lil +.
to_chat(H, "<span class='danger'>Your precious wings burn to a crisp!</span>")
H.dna.features["moth_wings"] = "Punished"
handle_mutant_bodyparts(H)

/datum/species/moth/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
. = ..()
if(chem.id == "pestkiller")
H.adjustToxLoss(3)
H.reagents.remove_reagent(chem.id, REAGENTS_METABOLISM)

/datum/species/moth/check_weakness(obj/item/weapon, mob/living/attacker)
if(istype(weapon, /obj/item/melee/flyswatter))
return 9 //Flyswatters deal 10x damage to moths.
return 0

//they can fly!
/datum/species/moth/space_move(mob/living/carbon/human/H)
. = ..()
if(H.loc && !isspaceturf(H.loc))
var/datum/gas_mixture/current = H.loc.return_air()
if(current && (current.return_pressure() >= ONE_ATMOSPHERE*0.75))
return TRUE