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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragons despawn with 10 mins between rifts, gib on death, etc #3017

Merged
merged 14 commits into from
Feb 23, 2025
23 changes: 22 additions & 1 deletion Content.Server/Dragon/Components/DragonComponent.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared.Damage; // DeltaV
using Content.Shared.NPC.Prototypes;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
Expand All @@ -21,7 +22,7 @@ public sealed partial class DragonComponent : Component
/// When any rift is destroyed how long is the dragon weakened for
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("weakenedDuration")]
public float WeakenedDuration = 120f;
public float WeakenedDuration = 60f;

/// <summary>
/// Has a rift been destroyed and the dragon in a temporary weakened state?
Expand Down Expand Up @@ -65,5 +66,25 @@ public sealed partial class DragonComponent : Component
/// </summary>
[DataField]
public ProtoId<NpcFactionPrototype> Faction = "Dragon";

/// <summary>
/// DeltaV: Damage dealt to dragon on death
/// So we dont just delete it
/// </summary>
[DataField]
public DamageSpecifier DeathDamage = new()
{
DamageDict = new()
{
{ "Blunt", 400 },
},
};

/// <summary>
/// DeltaV: Stops the halftime popup from displaying 1000 times
/// </summary>
[DataField]
public bool HalftimePopupShown;

}
}
17 changes: 14 additions & 3 deletions Content.Server/Dragon/DragonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Server.Popups;
using Content.Server.Roles;
using Content.Shared.Actions;
using Content.Shared.Damage; // DeltaV
using Content.Shared.Dragon;
using Content.Shared.Maps;
using Content.Shared.Mind;
Expand All @@ -20,6 +21,7 @@ namespace Content.Server.Dragon;

public sealed partial class DragonSystem : EntitySystem
{
[Dependency] private readonly DamageableSystem _damageable = default!; // DeltaV
[Dependency] private readonly CarpRiftsConditionSystem _carpRifts = default!;
[Dependency] private readonly ITileDefinitionManager _tileDef = default!;
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
Expand Down Expand Up @@ -97,12 +99,20 @@ public override void Update(float frameTime)
if (!_mobState.IsDead(uid))
comp.RiftAccumulator += frameTime;

// Delete it, naughty dragon!
if (comp.RiftAccumulator >= comp.RiftMaxAccumulator)
// Begin DeltaV Changes
if (!comp.HalftimePopupShown && Math.Round(comp.RiftAccumulator) == 0.5 * comp.RiftMaxAccumulator) // at halftime tell them they gonna die
{
Roar(uid, comp);
QueueDel(uid);
_popup.PopupEntity(Loc.GetString("deltav-dragon-halftime-popup"), uid, uid);
comp.HalftimePopupShown = true; // no spamming popups
}

if (comp.RiftAccumulator >= comp.RiftMaxAccumulator) // dragon is out of time
{
Roar(uid, comp);
_damageable.TryChangeDamage(uid, comp.DeathDamage,true,true); // gib time
}
// End DeltaV Changes
}
}

Expand Down Expand Up @@ -169,6 +179,7 @@ private void OnSpawnRift(EntityUid uid, DragonComponent component, DragonSpawnRi
var carpUid = Spawn(component.RiftPrototype, _transform.GetMapCoordinates(uid, xform: xform));
component.Rifts.Add(carpUid);
Comp<DragonRiftComponent>(carpUid).Dragon = uid;
component.HalftimePopupShown = false; // DeltaV - Reset popup flag
}

// TODO: just make this a move speed modifier component???
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ deltav-ghost-role-information-salvageantag-rules = You are a salvage mob.
You are allowed to attack salvagers without provocation. DO NOT GIB THEIR CORPSES!
You are allowed to attack the salvage shuttle.
You are NOT allowed to go to the station. If the salvagers go to the station, you can't follow them.

deltav-ghost-role-information-space-dragon-description = Call in 3 carp rifts and take over this quadrant! You must place a rift every 10 minutes or suffer the consequences!
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deltav-objective-carp-rifts-description = Use the rift action to open {$count} rifts and ensure they do not get destroyed. You must place one every 10 minutes until you have three!
deltav-dragon-halftime-popup = You only have five minutes left to place a rift!
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
components:
- type: GhostRole
name: ghost-role-information-space-dragon-name
description: ghost-role-information-space-dragon-description
description: deltav-ghost-role-information-space-dragon-description # DeltaV - Dragons despawn in 10 mins
rules: ghost-role-information-space-dragon-rules
mindRoles:
- MindRoleGhostRoleTeamAntagonist
Expand Down
4 changes: 3 additions & 1 deletion Resources/Prototypes/Entities/Mobs/Player/dragon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
allowSpeech: true
makeSentient: true
name: ghost-role-information-space-dragon-name
description: ghost-role-information-space-dragon-description
description: deltav-ghost-role-information-space-dragon-description # DeltaV - Dragons despawn in 10 minutes
rules: ghost-role-information-space-dragon-rules
mindRoles:
- MindRoleGhostRoleTeamAntagonist
Expand Down Expand Up @@ -163,6 +163,8 @@
components:
- type: Dragon
spawnRiftAction: ActionSpawnRift
maxAccumulator: 600 # DeltaV - Double the normal time
weakenedDuration: 60 # DeltaV - Half the normal time
- type: GuideHelp
guides:
- MinorAntagonists
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Objectives/dragon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
min: 3
max: 3
title: objective-carp-rifts-title
description: objective-carp-rifts-description
description: deltav-objective-carp-rifts-description # DeltaV - Dragons do not despawn
- type: CarpRiftsCondition

- type: entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
- Your [color=orange][italic]Dragon's Breath[/italic][/color] is a [bold]flaming projectile[/bold] which travels a straight flight path, exploding multiple times and igniting things along the way. Try not to hit your carps with this!
- You have the ability to [color=#4b7fcc][italic]Summon a Carp Rift[/italic][/color]. Rifts periodically spawn [bold]space carp[/bold] and charge up energy over a period of 5 minutes, [bold]which is when it's vulnerable.[/bold] After 5 minutes, it becomes invulnerable and will continue summoning carp as long as the dragon lives.
- You'll suffer a [bold]temporary debilitating feedback effect[/bold] if one of your rifts are destroyed before it's done charging.
- If a period of five minutes passes since your spawn or since the last time a rift was charging, [bold]you'll disappear.[/bold]
- If a period of ten minutes passes since your spawn or since the last time a rift was charging, [bold]you'll die.[/bold]
- Dragons who have the maximum of 3 fully charged rifts will [bold]never disappear[/bold], but they are still mortal.

# Slimes and Spiders
Expand Down
Loading