From fbca5f3985bbb1bba85cf0e27badbd4f2b3d3f69 Mon Sep 17 00:00:00 2001 From: unid15 Date: Thu, 20 Aug 2015 01:02:25 +0200 Subject: [PATCH 1/6] carp pheromones 1.0 --- code/modules/mob/living/simple_animal/hostile/bat.dm | 5 +++++ code/modules/mob/living/simple_animal/hostile/carp.dm | 6 ++++++ .../mob/living/simple_animal/hostile/hostile.dm | 11 ++++++----- code/modules/reagents/Chemistry-Reagents.dm | 7 +++++++ code/modules/reagents/Chemistry-Recipes.dm | 7 +++++++ html/changelogs/unid_carp.yml | 6 ++++++ 6 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 html/changelogs/unid_carp.yml diff --git a/code/modules/mob/living/simple_animal/hostile/bat.dm b/code/modules/mob/living/simple_animal/hostile/bat.dm index d02992652fc..aad54402a74 100644 --- a/code/modules/mob/living/simple_animal/hostile/bat.dm +++ b/code/modules/mob/living/simple_animal/hostile/bat.dm @@ -46,6 +46,11 @@ /mob/living/simple_animal/hostile/scarybat/Process_Spacemove(var/check_drift = 0) return ..() //No drifting in space for space carp! //original comments do not steal +/mob/living/simple_animal/hostile/scarybat/IsInvalidTarget(atom/A) + ..() + if(A == owner) + return 1 + /mob/living/simple_animal/hostile/scarybat/FindTarget() . = ..() if(.) diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index a7806490d7b..8850960aa9b 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -66,6 +66,12 @@ var/global/ /mob/living/simple_animal/hostile/carp/Process_Spacemove(var/check_drift = 0) return 1 //No drifting in space for space carp! //original comments do not steal +/mob/living/simple_animal/hostile/carp/IsInvalidTarget(atom/A) + ..() + + if(A.reagents && A.reagents.has_reagent("carppheromones")) + return 1 + /mob/living/simple_animal/hostile/carp/FindTarget() . = ..() if(.) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index f60cdfd6e73..fe97a1aecc7 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -81,6 +81,10 @@ L += Objects return L +/mob/living/simple_animal/hostile/proc/IsInvalidTarget(atom/A) + if(isMoMMI(A)) + return 1 + /mob/living/simple_animal/hostile/proc/FindTarget()//Step 2, filter down possible targets to things we actually care about //writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/mob/living/simple_animal/hostile/proc/FindTarget() called tick#: [world.time]") var/list/Targets = list() @@ -92,11 +96,8 @@ Targets = FoundTarget break if(CanAttack(A))//Can we attack it? - if(isMoMMI(A)) - continue - if(istype(src, /mob/living/simple_animal/hostile/scarybat)) - if(A == src:owner) - continue + if(IsInvalidTarget(A)) continue + Targets += A continue Target = PickTarget(Targets) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index bd86fa84017..84b137bb0a3 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -2762,6 +2762,13 @@ H.update_mutations() //update our mutation overlays H.update_body() +/datum/reagent/carp_pheromones + name = "carp pheromones" + id = "carppheromones" + description = "A disgusting liquid which is used by space carps to mark their territory and food." + reagent_state = LIQUID + color = "#6AAA96" // rgb: 106, 170, 150 + /datum/reagent/blackpepper name = "Black Pepper" id = "blackpepper" diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index b9264d5d285..7e1a483dcdc 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -563,6 +563,13 @@ datum required_reagents = list("sodiumchloride" = 1, "ethanol" = 1, "radium" = 1) result_amount = 3 + carp_pheromones + name = "Carp pheromones" + id = "carppheromones" + result = "carppheromones" + required_reagents = list("carpotoxin" = 1, "leporazine" = 1, "lithium" = 1) + result_amount = 3 + plasmasolidification name = "Solid Plasma" id = "solidplasma" diff --git a/html/changelogs/unid_carp.yml b/html/changelogs/unid_carp.yml new file mode 100644 index 00000000000..d5b82d61f0a --- /dev/null +++ b/html/changelogs/unid_carp.yml @@ -0,0 +1,6 @@ +author: Unid + +delete-after: True + +changes: + - rscadd: Added carp pheromones, created by mixing carpotoxin, leporazine and lithium. Space carps won't attack stuff containing them. From 660d64a278311b8cbddf441e13f63a12d5a2d4e8 Mon Sep 17 00:00:00 2001 From: unid15 Date: Thu, 20 Aug 2015 01:21:43 +0200 Subject: [PATCH 2/6] removes unused thing, slightly changes recipe and effect --- .../mob/living/simple_animal/hostile/carp.dm | 13 +++++++------ code/modules/reagents/Chemistry-Recipes.dm | 2 +- .../reagents/reagent_containers/food/snacks/meat.dm | 8 -------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index 8850960aa9b..f04d68c3b53 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -66,17 +66,18 @@ var/global/ /mob/living/simple_animal/hostile/carp/Process_Spacemove(var/check_drift = 0) return 1 //No drifting in space for space carp! //original comments do not steal -/mob/living/simple_animal/hostile/carp/IsInvalidTarget(atom/A) - ..() - - if(A.reagents && A.reagents.has_reagent("carppheromones")) - return 1 - /mob/living/simple_animal/hostile/carp/FindTarget() . = ..() if(.) emote("nashes at [.]") +/mob/living/simple_animal/hostile/carp/AttackTarget() + if(ismob(target) && target.reagents) + if(target.reagents.has_reagent("carppheromones")) + LoseTarget() + return 0 + ..() + /mob/living/simple_animal/hostile/carp/AttackingTarget() . =..() var/mob/living/carbon/L = . diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 7e1a483dcdc..f33428bb18b 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -567,7 +567,7 @@ datum name = "Carp pheromones" id = "carppheromones" result = "carppheromones" - required_reagents = list("carpotoxin" = 1, "leporazine" = 1, "lithium" = 1) + required_reagents = list("carpotoxin" = 1, "leporazine" = 1, "carbon" = 1) result_amount = 3 plasmasolidification diff --git a/code/modules/reagents/reagent_containers/food/snacks/meat.dm b/code/modules/reagents/reagent_containers/food/snacks/meat.dm index d15a7292d85..ebaaf00e3a3 100644 --- a/code/modules/reagents/reagent_containers/food/snacks/meat.dm +++ b/code/modules/reagents/reagent_containers/food/snacks/meat.dm @@ -81,14 +81,6 @@ reagents.add_reagent("hyperzine", 5) src.bitesize = 3 -/obj/item/weapon/reagent_containers/food/snacks/meat/mimic - name = "meat" - desc = "An ordinary slab of meat. Or is it?" - icon_state = "meat" - New() - ..() - reagents.add_reagent("mimicinum", 3) - /obj/item/weapon/reagent_containers/food/snacks/meat/egg name = "egg" desc = "An egg!" From 421a1a77b5ebf9b721e0df299719df81e08b01fd Mon Sep 17 00:00:00 2001 From: unid15 Date: Thu, 20 Aug 2015 03:35:49 +0200 Subject: [PATCH 3/6] final touches --- .../mob/living/simple_animal/hostile/carp.dm | 13 +++++------ code/modules/reagents/Chemistry-Reagents.dm | 22 ++++++++++++++++++- html/changelogs/unid_carp.yml | 3 ++- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index f04d68c3b53..87e1dc06e7e 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -66,18 +66,17 @@ var/global/ /mob/living/simple_animal/hostile/carp/Process_Spacemove(var/check_drift = 0) return 1 //No drifting in space for space carp! //original comments do not steal +/mob/living/simple_animal/hostile/carp/IsInvalidTarget(atom/A) + if(ismob(A) && A.reagents) + if(A.reagents.has_reagent("carppheromones")) + return 1 + ..() + /mob/living/simple_animal/hostile/carp/FindTarget() . = ..() if(.) emote("nashes at [.]") -/mob/living/simple_animal/hostile/carp/AttackTarget() - if(ismob(target) && target.reagents) - if(target.reagents.has_reagent("carppheromones")) - LoseTarget() - return 0 - ..() - /mob/living/simple_animal/hostile/carp/AttackingTarget() . =..() var/mob/living/carbon/L = . diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 84b137bb0a3..f668de970ea 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -2765,10 +2765,30 @@ /datum/reagent/carp_pheromones name = "carp pheromones" id = "carppheromones" - description = "A disgusting liquid which is used by space carps to mark their territory and food." + description = "A disgusting liquid with a horrible smell, which is used by space carps to mark their territory and food." reagent_state = LIQUID color = "#6AAA96" // rgb: 106, 170, 150 +/datum/reagent/carp_pheromones/on_mob_life(var/mob/living/M as mob) + if(!holder) return + if(!M) M = holder.my_atom + if(!data) data = 0 + data++ + + var/stench_radius = Clamp(data * 0.1, 1, 6) //Stench starts out with 1 tile radius and grows after every 10 life ticks + + if(prob(5)) // 5% chance of stinking per life() + for(var/mob/living/carbon/C in oview(stench_radius,M)) //All other carbons in 4 tile radius (excluding our mob) + if(C.stat) return + if(istype(C.wear_mask)) + var/obj/item/clothing/mask/c_mask = C.wear_mask + if(c_mask.body_parts_covered & MOUTH) continue //If the carbon's mouth is covered, let's assume they don't smell it + + C << "You are engulfed by a [pick("tremendous","foul","disgusting","horrible")] stench emanating from [M]!" + + ..() + return + /datum/reagent/blackpepper name = "Black Pepper" id = "blackpepper" diff --git a/html/changelogs/unid_carp.yml b/html/changelogs/unid_carp.yml index d5b82d61f0a..a0325eb5922 100644 --- a/html/changelogs/unid_carp.yml +++ b/html/changelogs/unid_carp.yml @@ -3,4 +3,5 @@ author: Unid delete-after: True changes: - - rscadd: Added carp pheromones, created by mixing carpotoxin, leporazine and lithium. Space carps won't attack stuff containing them. + - rscadd: Added carp pheromones, created by mixing carpotoxin, leporazine and carbon. + - rscadd: Ingesting carp pheromones will make space carps not mind you around them. However, it won't affect carps who are already attacking you. From b276df9a491ee65a66786991ded9793d83a7ee6b Mon Sep 17 00:00:00 2001 From: unid15 Date: Sat, 22 Aug 2015 17:35:47 +0200 Subject: [PATCH 4/6] baby carps follow source of pheromones, holocarps don't give a shit --- .../mob/living/simple_animal/hostile/carp.dm | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index 87e1dc06e7e..284a4db78cf 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -1,4 +1,6 @@ -var/global/ +#define PHEROMONES_NO_EFFECT 0 +#define PHEROMONES_NEUTRAL 1 +#define PHEROMONES_FOLLOW 2 /mob/living/simple_animal/hostile/carp name = "space carp" @@ -42,6 +44,9 @@ var/global/ faction = "carp" + var/pheromones_act = PHEROMONES_NEUTRAL //This variable determines how carps act to pheromones. Big carps won't attack the source, + //baby carps follow the source and holocarps don't give a shit + /mob/living/simple_animal/hostile/carp/New() .=..() gender = pick(MALE, FEMALE) @@ -68,8 +73,8 @@ var/global/ /mob/living/simple_animal/hostile/carp/IsInvalidTarget(atom/A) if(ismob(A) && A.reagents) - if(A.reagents.has_reagent("carppheromones")) - return 1 + if(pheromones_act == PHEROMONES_NEUTRAL && A.reagents.has_reagent("carppheromones")) + return 1 //Carps who avoid pheromones don't target mobs with pheromones in their system. They just ignore them! ..() /mob/living/simple_animal/hostile/carp/FindTarget() @@ -78,6 +83,12 @@ var/global/ emote("nashes at [.]") /mob/living/simple_animal/hostile/carp/AttackingTarget() + if(!target) return + + if(pheromones_act == PHEROMONES_FOLLOW && target.reagents && target.reagents.has_reagent("carppheromones")) + return //This might be a bit hacky. The purpose of this is to prevent carps who are attracted to pheromones from attacking + //the source. Instead, it simply follows it. + . =..() var/mob/living/carbon/L = . if(istype(L)) @@ -103,7 +114,12 @@ var/global/ icon_state = "holocarp" icon_living = "holocarp" can_breed = 0 + pheromones_act = PHEROMONES_NO_EFFECT /mob/living/simple_animal/hostile/carp/holocarp/Die() qdel(src) return + +#undef PHEROMONES_NO_EFFECT +#undef PHEROMONES_NEUTRAL +#undef PHEROMONES_FOLLOW From 7c97942633766eae9bcd5108d1776557563cf647 Mon Sep 17 00:00:00 2001 From: unid15 Date: Sat, 22 Aug 2015 17:47:11 +0200 Subject: [PATCH 5/6] changelog, fixes baby carps, changes metabolism of pheromones --- code/modules/mob/living/simple_animal/hostile/carp.dm | 2 ++ code/modules/reagents/Chemistry-Reagents.dm | 1 + html/changelogs/unid_carp.yml | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm index 284a4db78cf..be9c8eeca8c 100644 --- a/code/modules/mob/living/simple_animal/hostile/carp.dm +++ b/code/modules/mob/living/simple_animal/hostile/carp.dm @@ -110,6 +110,8 @@ melee_damage_upper = 8 melee_damage_lower = 8 + pheromones_act = PHEROMONES_FOLLOW + /mob/living/simple_animal/hostile/carp/holocarp icon_state = "holocarp" icon_living = "holocarp" diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index f668de970ea..530f5c62c1f 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -2768,6 +2768,7 @@ description = "A disgusting liquid with a horrible smell, which is used by space carps to mark their territory and food." reagent_state = LIQUID color = "#6AAA96" // rgb: 106, 170, 150 + custom_metabolism = 0.1 /datum/reagent/carp_pheromones/on_mob_life(var/mob/living/M as mob) if(!holder) return diff --git a/html/changelogs/unid_carp.yml b/html/changelogs/unid_carp.yml index a0325eb5922..5326585861f 100644 --- a/html/changelogs/unid_carp.yml +++ b/html/changelogs/unid_carp.yml @@ -4,4 +4,4 @@ delete-after: True changes: - rscadd: Added carp pheromones, created by mixing carpotoxin, leporazine and carbon. - - rscadd: Ingesting carp pheromones will make space carps not mind you around them. However, it won't affect carps who are already attacking you. + - rscadd: Adult space carps ignore mobs with carp pheromones, baby space carp follow them instead (without attacking). From c1e4b19ed04086ab839483664903492a511d6f31 Mon Sep 17 00:00:00 2001 From: unid15 Date: Sat, 22 Aug 2015 18:03:37 +0200 Subject: [PATCH 6/6] adds parentheses --- code/modules/mob/living/simple_animal/hostile/hostile.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index fe97a1aecc7..9efbabf10ac 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -125,11 +125,11 @@ return 0 if(isliving(the_target) && search_objects < 2) var/mob/living/L = the_target - if(L.stat > stat_attack || L.stat != stat_attack && stat_exclusive == 1) + if(L.stat > stat_attack || (L.stat != stat_attack && stat_exclusive == 1)) return 0 if(L.flags & INVULNERABLE) return 0 - if(L.faction == src.faction && !attack_same || L.faction != src.faction && attack_same == 2 || L.faction != attack_faction && attack_faction) + if((L.faction == src.faction && !attack_same) || (L.faction != src.faction && attack_same == 2) || (L.faction != attack_faction && attack_faction)) return 0 if(iscultist(L) && (faction == "cult")) return 0