Rat King Tweaks (#8940)

Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
EmoGarbage404
2022-06-18 19:21:07 -04:00
committed by GitHub
parent 2579e83e04
commit 39d439795f
9 changed files with 124 additions and 29 deletions

View File

@@ -39,16 +39,9 @@ namespace Content.Server.RatKing
public float HungerPerDomainUse = 50f;
/// <summary>
/// The disease prototype id that the Domain ability spreads
/// How many moles of Miasma are released after one us of Domain
/// </summary>
[ViewVariables, DataField("domainDiseaseId", customTypeSerializer: typeof(PrototypeIdSerializer<DiseasePrototype>))]
public string DomainDiseaseId = "Plague";
/// <summary>
/// The range of the Domain ability.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("domainRange")]
public float DomainRange = 3f;
[ViewVariables, DataField("molesMiasmaPerDomain")]
public float MolesMiasmaPerDomain = 75f;
}
};

View File

@@ -1,9 +1,11 @@
using Content.Server.Actions;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Disease;
using Content.Server.Disease.Components;
using Content.Server.Nutrition.Components;
using Content.Server.Popups;
using Content.Shared.Actions;
using Content.Shared.Atmos;
using Robust.Shared.Player;
namespace Content.Server.RatKing
@@ -14,6 +16,7 @@ namespace Content.Server.RatKing
[Dependency] private readonly ActionsSystem _action = default!;
[Dependency] private readonly DiseaseSystem _disease = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly AtmosphereSystem _atmos = default!;
public override void Initialize()
{
@@ -54,8 +57,8 @@ namespace Content.Server.RatKing
}
/// <summary>
/// Gets all of the nearby disease-carrying entities in a radius
/// and gives them the specified disease. It has a hunger cost as well
/// uses hunger to release a specific amount of miasma into the air. This heals the rat king
/// and his servants through a specific metabolism.
/// </summary>
private void OnDomain(EntityUid uid, RatKingComponent component, RatKingDomainActionEvent args)
{
@@ -74,17 +77,11 @@ namespace Content.Server.RatKing
args.Handled = true;
hunger.CurrentHunger -= component.HungerPerDomainUse;
_popup.PopupEntity(Loc.GetString("rat-king-domain-popup"), uid, Filter.Pvs(uid, default, EntityManager));
_popup.PopupEntity(Loc.GetString("rat-king-domain-popup"), uid, Filter.Pvs(uid));
var tstalker = GetEntityQuery<DiseaseCarrierComponent>();
foreach (var entity in _lookup.GetEntitiesInRange(uid, component.DomainRange)) //go through all of them, filtering only those in range that are not the king itself
{
if (entity == uid)
continue;
if (tstalker.TryGetComponent(entity, out var diseasecomp))
_disease.TryInfect(diseasecomp, component.DomainDiseaseId); //infect them with w/e disease
}
var tileMix = _atmos.GetTileMixture(Transform(uid).Coordinates);
if (tileMix != null)
tileMix.AdjustMoles(Gas.Miasma, component.MolesMiasmaPerDomain);
}
}

View File

@@ -2,7 +2,7 @@ rat-king-raise-army-name = Raise Army
rat-king-raise-army-description = Spend some hunger to summon an allied rat to help defend you.
rat-king-domain-name = Rat King's Domain
rat-king-domain-description = Spend some hunger to infect those around you with the plague.
rat-king-domain-popup = A cloud of plague is released into the air!
rat-king-domain-description = Spend some hunger to release a cloud of miasma into the air.
rat-king-domain-popup = A cloud of miasma is released into the air!
rat-king-too-hungry = You are too hungry to use this ability!

View File

@@ -0,0 +1,8 @@
- type: entity
id: OrganRatLungs
parent: OrganHumanLungs
suffix: "rat"
components:
- type: Metabolizer
metabolizerTypes: [ Rat ]

View File

@@ -0,0 +1,39 @@
# Just copypasta of some animal basic body parts for interaction,
# It's basically as animals except a different torso with different organs
- type: entity
id: TorsoRat
name: "animal torso"
parent: PartAnimal
noSpawn: true
components:
- type: BodyPart
partType: Torso
size: 7
compatibility: Biological
mechanisms:
- OrganRatLungs
- OrganHumanStomach
- OrganHumanLiver
- OrganHumanHeart
- OrganHumanKidneys
- type: Damageable
damageContainer: Biological
- type: entity
id: OrganRatLungs
parent: BaseAnimalOrgan
name: lungs
noSpawn: true
components:
- type: Mechanism
size: 1
compatibility: Biological
- type: Lung
- type: Metabolizer
removeEmpty: true
solutionOnBody: false
solution: "Lung"
metabolizerTypes: [ Rat ]
groups:
- id: Gas
rateModifier: 100.0

View File

@@ -0,0 +1,7 @@
- type: bodyPreset
name: "animal preset"
id: RatPreset
partIDs:
legs: LegsAnimal
feet: FeetAnimal
torso: TorsoRat

View File

@@ -15,3 +15,6 @@
- type: metabolizerType
id: Vox
- type: metabolizerType
id: Rat

View File

@@ -50,6 +50,9 @@
types:
Slash: 12
Piercing: 8
- type: Body
template: AnimalTemplate
preset: RatPreset
- type: Appearance
- type: DamageStateVisuals
rotate: true
@@ -100,6 +103,13 @@
amount: 1
- type: DiseaseCarrier
carrierDiseases:
- VentCough
- AMIV
- SpaceCold
- SpaceFlu
- Bird Flew
- VanAusdallsRobovirus
- BleedersBite
- Plague
- type: SlowOnDamage
speedModifierThresholds:
@@ -117,8 +127,8 @@
components:
- type: CombatMode
- type: MovementSpeedModifier
baseWalkSpeed : 4
baseSprintSpeed : 4
baseWalkSpeed : 3.5
baseSprintSpeed : 3.5
- type: UtilityAI
behaviorSets:
- Idle
@@ -151,8 +161,8 @@
- type: MobState
thresholds:
0: !type:NormalMobState {}
25: !type:CriticalMobState {}
50: !type:DeadMobState {}
30: !type:CriticalMobState {}
60: !type:DeadMobState {}
- type: MeleeWeapon
range: 1
arcwidth: 0
@@ -160,7 +170,10 @@
damage:
types:
Slash: 5
Piercing: 2
Piercing: 3
- type: Body
template: AnimalTemplate
preset: RatPreset
- type: Appearance
- type: DamageStateVisuals
rotate: true
@@ -174,6 +187,13 @@
- type: Puller
- type: DiseaseCarrier
carrierDiseases:
- VentCough
- AMIV
- SpaceCold
- SpaceFlu
- Bird Flew
- VanAusdallsRobovirus
- BleedersBite
- Plague
- type: Vocal
# mice are gender neutral who cares

View File

@@ -17,6 +17,10 @@
conditions:
- !type:OrganType
type: Animal
- !type:Oxygenate
conditions:
- !type:OrganType
type: Rat
# Convert Oxygen into CO2.
- !type:ModifyLungGas
conditions:
@@ -157,6 +161,9 @@
effects:
- !type:ChemCauseRandomDisease
conditions:
- !type:OrganType
type: Rat
shouldHave: false
- !type:ReagentThreshold
reagent: Miasma
min: 1
@@ -168,8 +175,12 @@
- Bird Flew
- VanAusdallsRobovirus
- BleedersBite
- Plague
- !type:HealthChange
conditions:
- !type:OrganType
type: Rat
shouldHave: false
- !type:ReagentThreshold
reagent: Miasma
min: 1
@@ -181,6 +192,23 @@
- !type:ChemVomit
probability: 0.12
conditions:
- !type:OrganType
type: Rat
shouldHave: false
- !type:ReagentThreshold
reagent: Miasma
min: 0.8
- !type:HealthChange
conditions:
- !type:OrganType
type: Rat
- !type:ReagentThreshold
reagent: Miasma
min: 1
scaleByQuantity: true
ignoreResistances: true
damage:
types:
Blunt: -4
Slash: -3
Piercing: -3