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

Новый антагонист: Вампиры #560

Merged
merged 74 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
a092bad
Initial Commit
Rainfey Jan 9, 2024
76517c5
Unfinished
Rainfey Jan 11, 2024
793cbbc
Continuing, more abilities
Rainfey Jan 13, 2024
bd047c0
Remove necromicon healing
Rainfey Jan 13, 2024
bf66e69
oops
Rainfey Jan 13, 2024
adfdfb6
Continuing
Rainfey Jan 17, 2024
ca250a4
Continuing
Rainfey Jan 18, 2024
c862f3a
Checkpoint incase i need to undo something
Rainfey Jan 19, 2024
da2504f
Rewrite to use event per power, working passives
Rainfey Jan 20, 2024
7b18f77
Merge branch 'feature-vampires' of https://github.com/Rainfey/space-s…
Rinary1 Oct 28, 2024
bb545ed
refactor fixes
Rinary1 Oct 29, 2024
c629c50
so many fixes
Rinary1 Oct 29, 2024
9a37308
some fixes
Rinary1 Oct 29, 2024
2f5a98d
some fixes
Rinary1 Oct 29, 2024
e936beb
new textures, status icon
Rinary1 Oct 29, 2024
e4fd88d
vampire antag role, mind role
Rinary1 Oct 29, 2024
4561703
проверку на дауна вызывали?(если Null, у сервера ступор головного фат…
Rinary1 Oct 29, 2024
5d6c769
fix 1
Rinary1 Oct 29, 2024
bbb21f7
fix 2
Rinary1 Oct 29, 2024
6bbe4f7
fix fatal, fix build
Rinary1 Oct 29, 2024
52079be
breafing audio
Rinary1 Oct 29, 2024
e38c10e
fix icons style, store in action
Rinary1 Oct 29, 2024
0154ebe
clear store things, add gamerule, mid round game rule
Rinary1 Oct 29, 2024
f97e23b
some rework
Rinary1 Oct 29, 2024
e0354cb
clear any store systems
Rinary1 Oct 29, 2024
41e178f
clear x2
Rinary1 Oct 29, 2024
c8c0a9e
if you have 150 Blood Essence, you get mutation
Rinary1 Oct 29, 2024
b8f01f3
upd
Rinary1 Oct 29, 2024
7a030fe
some changes
Rinary1 Oct 29, 2024
f4a9487
simple mutation menu
Rinary1 Oct 29, 2024
92bbdbd
я вот сижу, в 12 ночи, пишу какую-то очередную хуйню, вместо приятног…
Rinary1 Oct 29, 2024
0b8f929
upd
Rinary1 Oct 30, 2024
6ed4298
Merge branch 'space-sunrise:master' into Vampires
Rinary1 Oct 30, 2024
8146612
Merge branch 'space-sunrise:master' into Vampires
Rinary1 Oct 30, 2024
54e4693
Merge branch 'master' of https://github.com/space-sunrise/space-stati…
Rinary1 Oct 30, 2024
2da2635
Merge branch 'master' of https://github.com/space-sunrise/space-stati…
Rinary1 Oct 30, 2024
3078ab0
normal mutations menu
Rinary1 Oct 30, 2024
25bdcc0
actions translate
Rinary1 Oct 30, 2024
16647a0
None type, base actions list
Rinary1 Oct 30, 2024
4b0e8be
passive abilities
Rinary1 Oct 30, 2024
9d02cca
ability earning
Rinary1 Oct 30, 2024
389059e
fix
Rinary1 Oct 30, 2024
21fb36b
translate vampire preset
Rinary1 Oct 30, 2024
0407ccf
translate vampire mutations menu
Rinary1 Oct 30, 2024
f270cdd
mutations menu textures
Rinary1 Oct 30, 2024
6191618
disable some
Rinary1 Oct 30, 2024
7818f28
ДРАНЫЙ БРИФ ФАТАЛКУ ПО ПРИКОЛУ БЕЕМ
Rinary1 Oct 30, 2024
5ddc73b
game preset
Rinary1 Oct 30, 2024
7d3eb64
Merge branch 'space-sunrise:master' into Vampires
Rinary1 Oct 30, 2024
059fab5
mutation can infinity changed
Rinary1 Oct 30, 2024
a617f77
fix
Rinary1 Oct 30, 2024
13c2220
fully rework abilities update system
Rinary1 Oct 30, 2024
74a6cb3
gargantua info
Rinary1 Oct 30, 2024
32eff4b
Merge branch 'master' of https://github.com/space-sunrise/space-stati…
Rinary1 Oct 31, 2024
0863cfe
update ignore list
Rinary1 Oct 31, 2024
c69424c
fix gargantua passives
Rinary1 Oct 31, 2024
7292014
vampire objectives
Rinary1 Oct 31, 2024
bf3df63
new icons
Rinary1 Oct 31, 2024
09578c2
balance
Rinary1 Oct 31, 2024
3b8cd68
fix
Rinary1 Oct 31, 2024
7978338
upd objectives
Rinary1 Oct 31, 2024
1228f0e
fix metabolizer type, balance 2
Rinary1 Oct 31, 2024
287eef4
fix metabolizer type 2
Rinary1 Oct 31, 2024
5fc2436
fix syntax
Rinary1 Oct 31, 2024
d65aaa7
clear translation
Rinary1 Oct 31, 2024
cc5aa4b
xd
Rinary1 Oct 31, 2024
c723b60
update
Rinary1 Oct 31, 2024
eae5ced
round end info
Rinary1 Oct 31, 2024
6259732
fix
Rinary1 Oct 31, 2024
4e1b597
drain objective fix
Rinary1 Oct 31, 2024
4110053
fix
Rinary1 Oct 31, 2024
6aeb741
fix syntax
Rinary1 Oct 31, 2024
0a1a9e5
fix
Rinary1 Oct 31, 2024
c24223a
clear
Rinary1 Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Content.Client/Vampire/VampireMutationBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Content.Shared.Vampire;
using Content.Shared.Vampire.Components;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
namespace Content.Client.Vampire;
[UsedImplicitly]
public sealed class VampireMutationBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private VampireMutationMenu? _menu;
public VampireMutationBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_menu = new VampireMutationMenu();
_menu.OnClose += Close;
_menu.OnIdSelected += OnIdSelected;
_menu.OpenCentered();
}
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not VampireMutationBoundUserInterfaceState st)
return;
_menu?.UpdateState(st.MutationList, st.SelectedMutation);
}
private void OnIdSelected(VampireMutationsType selectedId)
{
SendMessage(new VampireMutationPrototypeSelectedMessage(selectedId));
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
{
_menu?.Close();
_menu = null;
}
}
}
11 changes: 11 additions & 0 deletions Content.Client/Vampire/VampireMutationMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<DefaultWindow xmlns="https://spacestation14.io"
Title="{Loc 'vampire-mutation-menu-ui-window-name'}"
MinSize="250 300"
SetSize="250 300">
<BoxContainer Orientation="Vertical">
<ScrollContainer VerticalExpand="True">
<GridContainer Name="Grid" Columns="3" Margin="0 5" >
</GridContainer>
</ScrollContainer>
</BoxContainer>
</DefaultWindow>
92 changes: 92 additions & 0 deletions Content.Client/Vampire/VampireMutationMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
using System.Numerics;
using Content.Client.Stylesheets;
using Content.Shared.Vampire;
using Content.Shared.Vampire.Components;
using Content.Client.Resources;
using Robust.Client.ResourceManagement;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;

namespace Content.Client.Vampire;

[GenerateTypedNameReferences]
public sealed partial class VampireMutationMenu : DefaultWindow
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
private IResourceCache _resourceCache;
private readonly SpriteSystem _sprite;
public event Action<VampireMutationsType>? OnIdSelected;

private HashSet<VampireMutationsType> _possibleMutations = new();
private VampireMutationsType _selectedId;

public VampireMutationMenu()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_sprite = _entityManager.System<SpriteSystem>();
_resourceCache = IoCManager.Resolve<IResourceCache>();
}

public void UpdateState(HashSet<VampireMutationsType> mutationList, VampireMutationsType selectedMutation)
{
_possibleMutations = mutationList;
_selectedId = selectedMutation;
UpdateGrid();
}

private void UpdateGrid()
{
ClearGrid();

var group = new ButtonGroup();

foreach (var Mutation in _possibleMutations)
{
//if (!_prototypeManager.TryIndex("NormalBlobTile", out EntityPrototype? proto))
// continue;

string texturePath = Mutation switch
{
VampireMutationsType.None => "/Textures/Interface/Actions/actions_vampire.rsi/deathsembrace.png",
VampireMutationsType.Hemomancer => "/Textures/Interface/Actions/actions_vampire.rsi/hemomancer.png",
VampireMutationsType.Umbrae => "/Textures/Interface/Actions/actions_vampire.rsi/umbrae.png",
VampireMutationsType.Gargantua => "/Textures/Interface/Actions/actions_vampire.rsi/gargantua.png",
VampireMutationsType.Dantalion => "/Textures/Interface/Actions/actions_vampire.rsi/dantalion.png",
VampireMutationsType.Bestia => "/Textures/Interface/Actions/actions_vampire.rsi/bestia.png",
_ => "/Textures/Interface/Actions/actions_vampire.rsi/deathsembrace.png"
};

var button = new Button
{
MinSize = new Vector2(64, 64),
HorizontalExpand = true,
Group = group,
StyleClasses = {StyleBase.ButtonSquare},
ToggleMode = true,
Pressed = _selectedId == Mutation,
ToolTip = Loc.GetString($"vampire-mutation-{Mutation.ToString().ToLower()}-info"),
TooltipDelay = 0.01f,
};
button.OnPressed += _ => OnIdSelected?.Invoke(Mutation);
Grid.AddChild(button);

var texture = _resourceCache.GetTexture(texturePath);
button.AddChild(new TextureRect
{
Stretch = TextureRect.StretchMode.KeepAspectCentered,
Texture = texture,
});
}
}

private void ClearGrid()
{
Grid.RemoveAllChildren();
}
}
14 changes: 14 additions & 0 deletions Content.Server/Administration/Systems/AdminVerbSystem.Antags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,19 @@ private void AddAntagVerbs(GetVerbsEvent<Verb> args)
Message = Loc.GetString("admin-verb-make-changeling"),
};
args.Verbs.Add(ling);

Verb vampire = new()
{
Text = Loc.GetString("admin-verb-text-make-vampire"),
Category = VerbCategory.Antag,
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Actions/actions_vampire.rsi"), "unholystrength"),
Act = () =>
{
_antag.ForceMakeAntag<VampireRuleComponent>(targetPlayer, "Vampire");
},
Impact = LogImpact.High,
Message = Loc.GetString("admin-verb-make-vampire"),
};
args.Verbs.Add(vampire);
}
}
36 changes: 35 additions & 1 deletion Content.Server/Bible/BibleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
using Content.Shared.Mobs;
using Content.Shared.Mobs.Systems;
using Content.Shared.Popups;
using Content.Shared.Stunnable;
using Content.Shared.Timing;
using Content.Shared.Vampire.Components;
using Content.Shared.Verbs;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Timing;

namespace Content.Server.Bible
{
Expand All @@ -34,19 +38,35 @@ public sealed class BibleSystem : EntitySystem
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly UseDelaySystem _delay = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedStunSystem _stun = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<BibleComponent, AfterInteractEvent>(OnAfterInteract);
SubscribeLocalEvent<BibleComponent, EntGotInsertedIntoContainerMessage>(OnInsertedContainer);
SubscribeLocalEvent<SummonableComponent, GetVerbsEvent<AlternativeVerb>>(AddSummonVerb);
SubscribeLocalEvent<SummonableComponent, GetItemActionsEvent>(GetSummonAction);
SubscribeLocalEvent<SummonableComponent, SummonActionEvent>(OnSummon);
SubscribeLocalEvent<FamiliarComponent, MobStateChangedEvent>(OnFamiliarDeath);
SubscribeLocalEvent<FamiliarComponent, GhostRoleSpawnerUsedEvent>(OnSpawned);
}

private void OnInsertedContainer(EntityUid uid, BibleComponent component, EntGotInsertedIntoContainerMessage args)
{
//If an unholy creature picks up the bible, knock them down
if (HasComp<UnholyComponent>(args.Container.Owner))
{
Timer.Spawn(500, () =>
{
_stun.TryParalyze(args.Container.Owner, TimeSpan.FromSeconds(10), true);
_damageableSystem.TryChangeDamage(args.Container.Owner, component.DamageOnUnholyUse);
_audio.PlayPvs(component.SizzleSoundPath, args.Container.Owner);
});
}
}

private readonly Queue<EntityUid> _addQueue = new();
private readonly Queue<EntityUid> _remQueue = new();

Expand Down Expand Up @@ -116,7 +136,21 @@ private void OnAfterInteract(EntityUid uid, BibleComponent component, AfterInter
return;
}

// This only has a chance to fail if the target is not wearing anything on their head and is not a familiar.
//Damage unholy creatures
if (HasComp<UnholyComponent>(args.Target))
{
_damageableSystem.TryChangeDamage(args.Target.Value, component.DamageUnholy, true, origin: uid);

var othersMessage = Loc.GetString(component.LocPrefix + "-damage-unholy-others", ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(args.Target.Value, EntityManager)), ("bible", uid));
_popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), true, PopupType.MediumCaution);

var selfMessage = Loc.GetString(component.LocPrefix + "-damage-unholy-self", ("target", Identity.Entity(args.Target.Value, EntityManager)), ("bible", uid));
_popupSystem.PopupEntity(selfMessage, args.User, args.User, PopupType.LargeCaution);

return;
}

// This only has a chance to fail if the target is not wearing anything on their head and is not a familiar..
if (!_invSystem.TryGetSlotEntity(args.Target.Value, "head", out var _) && !HasComp<FamiliarComponent>(args.Target.Value))
{
if (_random.Prob(component.FailChance))
Expand Down
8 changes: 8 additions & 0 deletions Content.Server/Bible/Components/BibleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public sealed partial class BibleComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier DamageOnUntrainedUse = default!;

[DataField("damageOnUnholyUse", required: true)]
[ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier DamageOnUnholyUse = default!;

[DataField("damageUnholy", required: true)]
[ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier DamageUnholy = default!;

/// <summary>
/// Chance the bible will fail to heal someone with no helmet
/// </summary>
Expand Down
26 changes: 26 additions & 0 deletions Content.Server/Body/Systems/MetabolizerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Administration.Logs;
using Content.Shared.Body.Organ;
using Content.Shared.Body.Prototypes;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Reagent;
Expand Down Expand Up @@ -230,6 +231,31 @@ private void TryMetabolize(Entity<MetabolizerComponent, OrganComponent?, Solutio

_solutionContainerSystem.UpdateChemicals(soln.Value);
}

public bool TryAddMetabolizerType(MetabolizerComponent component, string metabolizerType)
{
if (!_prototypeManager.HasIndex<MetabolizerTypePrototype>(metabolizerType))
return false;

if (component.MetabolizerTypes == null)
component.MetabolizerTypes = new();

return component.MetabolizerTypes.Add(metabolizerType);
}

public bool TryRemoveMetabolizerType(MetabolizerComponent component, string metabolizerType)
{
if (component.MetabolizerTypes == null)
return true;

return component.MetabolizerTypes.Remove(metabolizerType);
}

public void ClearMetabolizerTypes(MetabolizerComponent component)
{
if (component.MetabolizerTypes != null)
component.MetabolizerTypes.Clear();
}
}

// TODO REFACTOR THIS
Expand Down
6 changes: 6 additions & 0 deletions Content.Server/Body/Systems/StomachSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Shared.Body.Organ;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Whitelist;
using Robust.Shared.Timing;
using Robust.Shared.Utility;

Expand Down Expand Up @@ -130,5 +131,10 @@ public bool TryTransferSolution(

return true;
}

public void SetSpecialDigestible(StomachComponent component, EntityWhitelist? whitelist)
{
component.SpecialDigestible = whitelist;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Content.Shared.NPC.Prototypes;
using Content.Shared.Roles;
using Content.Shared.Vampire.Components;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;

namespace Content.Server.GameTicking.Rules.Components;

[RegisterComponent, Access(typeof(VampireRuleSystem))]
public sealed partial class VampireRuleComponent : Component
{
public readonly List<EntityUid> VampireMinds = new();


public readonly List<ProtoId<EntityPrototype>> BaseObjectives = new()
{
"VampireKillRandomPersonObjective",
"VampireDrainObjective"
};

public readonly List<ProtoId<EntityPrototype>> EscapeObjectives = new()
{
"VampireSurviveObjective",
"VampireEscapeObjective"
};

public readonly List<ProtoId<EntityPrototype>> StealObjectives = new()
{
"CMOHyposprayVampireStealObjective",
"RDHardsuitVampireStealObjective",
"EnergyShotgunVampireStealObjective",
"MagbootsVampireStealObjective",
"ClipboardVampireStealObjective",
"CaptainIDVampireStealObjective",
"CaptainJetpackVampireStealObjective",
"CaptainGunVampireStealObjective"
};
}
Loading
Loading