diff --git a/code/modules/mob/living/simple_animal/hostile/bat.dm b/code/modules/mob/living/simple_animal/hostile/bat.dm index df4172d612f..8c42f4ada16 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..be9c8eeca8c 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) @@ -66,12 +71,24 @@ 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(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() . = ..() if(.) 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)) @@ -93,11 +110,18 @@ var/global/ 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" 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 diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 4bc52683eb8..6d1bb417523 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -82,6 +82,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() @@ -93,11 +97,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) @@ -125,11 +126,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 diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 631aa54bae4..811b0eaff77 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -2762,6 +2762,34 @@ H.update_mutations() //update our mutation overlays H.update_body() +/datum/reagent/carp_pheromones + name = "carp pheromones" + id = "carppheromones" + 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 + 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/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index b9264d5d285..f33428bb18b 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, "carbon" = 1) + result_amount = 3 + plasmasolidification name = "Solid Plasma" id = "solidplasma" diff --git a/code/modules/reagents/reagent_containers/food/snacks/meat.dm b/code/modules/reagents/reagent_containers/food/snacks/meat.dm index b7d4aa29e6f..147d8d71edd 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!" diff --git a/html/changelogs/unid_carp.yml b/html/changelogs/unid_carp.yml new file mode 100644 index 00000000000..5326585861f --- /dev/null +++ b/html/changelogs/unid_carp.yml @@ -0,0 +1,7 @@ +author: Unid + +delete-after: True + +changes: + - rscadd: Added carp pheromones, created by mixing carpotoxin, leporazine and carbon. + - rscadd: Adult space carps ignore mobs with carp pheromones, baby space carp follow them instead (without attacking).