Skip to content

Commit 53c6fb9

Browse files
committed
Merge branch 'dev'
2 parents 61d8031 + f31a037 commit 53c6fb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1164
-99
lines changed

EXILED/EXILED.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<PropertyGroup>
1717
<!-- This is the global version and is used for all projects that don't have a version -->
18-
<Version Condition="$(Version) == ''">9.11.3</Version>
18+
<Version Condition="$(Version) == ''">9.12.2</Version>
1919
<!-- Enables public beta warning via the PUBLIC_BETA constant -->
2020
<PublicBeta>false</PublicBeta>
2121

EXILED/Exiled.API/Enums/EffectType.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public enum EffectType
216216
/// <summary>
217217
/// Makes you a marshmallow guy.
218218
/// </summary>
219-
[Obsolete("Not functional in-game")]
219+
// [Obsolete("Not functional in-game")]
220220
Marshmallow,
221221

222222
/// <summary>
@@ -261,25 +261,25 @@ public enum EffectType
261261
Blurred,
262262

263263
/// <summary>
264-
/// Makes you a flamingo.
264+
/// Makes you a flamingo <see cref="CustomPlayerEffects.BecomingFlamingo"/>.
265265
/// </summary>
266266
// [Obsolete("Only availaible for Christmas and AprilFools.")]
267267
BecomingFlamingo,
268268

269269
/// <summary>
270-
/// Makes you a Child after eating Cake.
270+
/// Makes you a Child after eating Cake <see cref="Scp559Effect"/>.
271271
/// </summary>
272272
// [Obsolete("Only availaible for Christmas and AprilFools.")]
273273
Scp559,
274274

275275
/// <summary>
276-
/// Scp956 found you.
276+
/// Scp956 found you <see cref="global::Scp956Target"/>.
277277
/// </summary>
278278
// [Obsolete("Only availaible for Christmas and AprilFools.")]
279279
Scp956Target,
280280

281281
/// <summary>
282-
/// you are snowed.
282+
/// you are snowed <see cref="global::Snowed"/>.
283283
/// </summary>
284284
// [Obsolete("Only availaible for Christmas and AprilFools.")]
285285
Snowed,
@@ -317,73 +317,73 @@ public enum EffectType
317317
/// <summary>
318318
/// <see cref="CustomPlayerEffects.Metal"/>.
319319
/// </summary>
320-
// [Obsolete("Only availaible for Halloween.")]
320+
[Obsolete("Only availaible for Halloween.")]
321321
Metal,
322322

323323
/// <summary>
324324
/// <see cref="CustomPlayerEffects.OrangeCandy"/>.
325325
/// </summary>
326-
// [Obsolete("Only availaible for Halloween.")]
326+
[Obsolete("Only availaible for Halloween.")]
327327
OrangeCandy,
328328

329329
/// <summary>
330330
/// <see cref="CustomPlayerEffects.OrangeWitness"/>.
331331
/// </summary>
332-
// [Obsolete("Only availaible for Halloween.")]
332+
[Obsolete("Only availaible for Halloween.")]
333333
OrangeWitness,
334334

335335
/// <summary>
336336
/// <see cref="CustomPlayerEffects.Prismatic"/>.
337337
/// </summary>
338-
// [Obsolete("Only availaible for Halloween.")]
338+
[Obsolete("Only availaible for Halloween.")]
339339
Prismatic,
340340

341341
/// <summary>
342342
/// <see cref="CustomPlayerEffects.SlowMetabolism"/>.
343343
/// </summary>
344-
// [Obsolete("Only availaible for Halloween.")]
344+
[Obsolete("Only availaible for Halloween.")]
345345
SlowMetabolism,
346346

347347
/// <summary>
348348
/// <see cref="CustomPlayerEffects.Spicy"/>.
349349
/// </summary>
350-
// [Obsolete("Only availaible for Halloween.")]
350+
[Obsolete("Only availaible for Halloween.")]
351351
Spicy,
352352

353353
/// <summary>
354354
/// <see cref="CustomPlayerEffects.SugarCrave"/>.
355355
/// </summary>
356-
// [Obsolete("Only availaible for Halloween.")]
356+
// [Obsolete("Only availaible for Halloween or Christmas.")]
357357
SugarCrave,
358358

359359
/// <summary>
360360
/// <see cref="CustomPlayerEffects.SugarHigh"/>.
361361
/// </summary>
362-
// [Obsolete("Only availaible for Halloween.")]
362+
[Obsolete("Only availaible for Halloween.")]
363363
SugarHigh,
364364

365365
/// <summary>
366366
/// <see cref="CustomPlayerEffects.SugarRush"/>.
367367
/// </summary>
368-
// [Obsolete("Only availaible for Halloween.")]
368+
[Obsolete("Only availaible for Halloween.")]
369369
SugarRush,
370370

371371
/// <summary>
372372
/// <see cref="CustomPlayerEffects.TemporaryBypass"/>.
373373
/// </summary>
374-
// [Obsolete("Only availaible for Halloween.")]
374+
[Obsolete("Only availaible for Halloween.")]
375375
TemporaryBypass,
376376

377377
/// <summary>
378378
/// <see cref="CustomPlayerEffects.TraumatizedByEvil"/>.
379379
/// </summary>
380-
// [Obsolete("Only availaible for Halloween.")]
380+
[Obsolete("Only availaible for Halloween.")]
381381
TraumatizedByEvil,
382382

383383
/// <summary>
384384
/// <see cref="CustomPlayerEffects.WhiteCandy"/>.
385385
/// </summary>
386-
// [Obsolete("Only availaible for Halloween.")]
386+
[Obsolete("Only availaible for Halloween.")]
387387
WhiteCandy,
388388

389389
/// <summary>

EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ public static DamageType GetDamageType(DamageHandlerBase damageHandlerBase)
204204
Log.Warn($"{nameof(DamageTypeExtensions)}.{nameof(damageHandlerBase)}: No matching {nameof(DamageType)} for {nameof(UniversalDamageHandler)} with ID {translation.Id}, type will be reported as {DamageType.Unknown}. Report this to EXILED Devs.");
205205
return DamageType.Unknown;
206206
}
207+
208+
case AttackerDamageHandler attackerDamageHandler:
209+
{
210+
if (Player.TryGet(attackerDamageHandler.Attacker, out Player attacker) && attacker.CurrentItem?.Type == ItemType.MarshmallowItem)
211+
return DamageType.Marshmallow;
212+
return DamageType.Unknown;
213+
}
207214
}
208215

209216
return DamageType.Unknown;

EXILED/Exiled.API/Features/Cassie.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Team.FoundationForces when NamingRulesManager.TryGetNamingRule(team, out UnitNam
151151
Team.ChaosInsurgency => "BY CHAOSINSURGENCY",
152152
Team.Scientists => "BY SCIENCE PERSONNEL",
153153
Team.ClassD => "BY CLASSD PERSONNEL",
154-
Team.Flamingos => "BY FLAMINGOS",
154+
Team.Flamingos => "BY SCP 1 5 0 7",
155155
_ => "UNKNOWN",
156156
};
157157

EXILED/Exiled.API/Features/DamageHandlers/DamageHandlerBase.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,13 @@ protected DamageType GetDamageType(BaseHandler damageHandler = null)
271271
FirearmType.FRMG0 => DamageType.Frmg0,
272272
_ => DamageType.Firearm
273273
};
274+
275+
case PlayerStatsSystem.AttackerDamageHandler attackerDamageHandler:
276+
{
277+
if (Player.TryGet(attackerDamageHandler.Attacker, out Player attacker) && attacker.CurrentItem?.Type == ItemType.MarshmallowItem)
278+
return DamageType.Marshmallow;
279+
return DamageType.Unknown;
280+
}
274281
}
275282

276283
return DamageType.Unknown;

EXILED/Exiled.API/Features/Effect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public Effect(StatusEffectBase statusEffectBase)
3535
if (!statusEffectBase.TryGetEffectType(out EffectType effect))
3636
Log.Error($"EffectType not found please report to Exiled BugReport : {statusEffectBase}");
3737
Type = effect;
38-
Duration = statusEffectBase.Duration;
38+
Duration = statusEffectBase.TimeLeft;
3939
Intensity = statusEffectBase.Intensity;
4040
IsEnabled = statusEffectBase.IsEnabled;
4141
}

EXILED/Exiled.API/Features/Items/Item.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace Exiled.API.Features.Items
2222
using InventorySystem.Items.Firearms.Ammo;
2323
using InventorySystem.Items.Jailbird;
2424
using InventorySystem.Items.Keycards;
25+
using InventorySystem.Items.MarshmallowMan;
2526
using InventorySystem.Items.MicroHID;
2627
using InventorySystem.Items.Pickups;
2728
using InventorySystem.Items.Radio;
@@ -260,6 +261,7 @@ public static Item Get(ItemBase itemBase)
260261
_ => new Throwable(throwable),
261262
},
262263
Scp1509Item scp1509 => new Scp1509(scp1509),
264+
MarshmallowItem marshmallow => new Marshmallow(marshmallow),
263265
_ => new(itemBase),
264266
};
265267
}
@@ -364,6 +366,7 @@ public static T Get<T>(ushort serial)
364366
_ => new Throwable(type, owner),
365367
},
366368
Scp1509Item => new Scp1509(),
369+
MarshmallowItem => new Marshmallow(type, owner),
367370
_ => new(type),
368371
};
369372

EXILED/Exiled.API/Features/Items/Keycards/ChaosKeycard.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ internal ChaosKeycard(ItemType type)
4343
/// <summary>
4444
/// Gets the <see cref="InventorySystem.Items.Keycards.Snake.SnakeEngine"/> this encapsulates.
4545
/// </summary>
46-
public SnakeEngine SnakeEngine => Base._localEngine;
46+
/// <remarks>Can be null, but shouldn't be during usage.</remarks>
47+
public SnakeEngine SnakeEngine => ChaosKeycardItem.SnakeSessions.TryGetValue(Serial, out SnakeEngine engine) ? engine : null;
4748

4849
/// <summary>
4950
/// Returns the Keycard in a human readable format.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// -----------------------------------------------------------------------
2+
// <copyright file="Marshmallow.cs" company="ExMod Team">
3+
// Copyright (c) ExMod Team. All rights reserved.
4+
// Licensed under the CC BY-SA 3.0 license.
5+
// </copyright>
6+
// -----------------------------------------------------------------------
7+
8+
namespace Exiled.API.Features.Items
9+
{
10+
using CustomPlayerEffects;
11+
using Exiled.API.Interfaces;
12+
using InventorySystem.Items.MarshmallowMan;
13+
using PlayerStatsSystem;
14+
using UnityEngine;
15+
16+
/// <summary>
17+
/// A wrapper class for <see cref="MarshmallowItem"/>.
18+
/// </summary>
19+
public class Marshmallow : Item, IWrapper<MarshmallowItem>
20+
{
21+
/// <summary>
22+
/// Initializes a new instance of the <see cref="Marshmallow"/> class.
23+
/// </summary>
24+
/// <param name="itemBase">The base <see cref="MarshmallowItem"/> class.</param>
25+
public Marshmallow(MarshmallowItem itemBase)
26+
: base(itemBase)
27+
{
28+
Base = itemBase;
29+
}
30+
31+
/// <summary>
32+
/// Initializes a new instance of the <see cref="Marshmallow"/> class.
33+
/// </summary>
34+
/// <param name="type">The <see cref="ItemType"/> of the marshmallow item.</param>
35+
/// <param name="owner">The owner of the marshmallow item. Leave <see langword="null"/> for no owner.</param>
36+
internal Marshmallow(ItemType type, Player owner = null)
37+
: base((MarshmallowItem)(owner ?? Server.Host).Inventory.CreateItemInstance(new(type, 0), false))
38+
{
39+
}
40+
41+
/// <summary>
42+
/// Gets the <see cref="MarshmallowItem"/> that this class is encapsulating.
43+
/// </summary>
44+
public new MarshmallowItem Base { get; }
45+
46+
/// <summary>
47+
/// Gets a value indicating whether this marshmallow man is evil.
48+
/// </summary>
49+
/// <remarks>See <see cref="MakeEvil"/> in regards to making a marshmallow evil.</remarks>
50+
public bool Evil => Base.EvilMode;
51+
52+
/// <summary>
53+
/// Gets or sets the <see cref="AhpStat.AhpProcess"/> of the marshmallow man that would be used if he was evil.
54+
/// </summary>
55+
public AhpStat.AhpProcess EvilAhpProcess
56+
{
57+
get => Base.EvilAHPProcess;
58+
set
59+
{
60+
if (Evil && value is null)
61+
return;
62+
63+
Base.EvilAHPProcess = value;
64+
}
65+
}
66+
67+
/// <summary>
68+
/// Cackles for the owner even if they are not evil.
69+
/// </summary>
70+
/// <param name="cooldown">How long until the player can cackle again (negative values do not affect current cooldown).</param>
71+
/// <param name="duration">How long players near the marshmallow man get effected by <see cref="TraumatizedByEvil"/>.</param>
72+
public void Cackle(double cooldown = -1, float duration = 5)
73+
{
74+
if (cooldown >= 0)
75+
Base._cackleCooldown.Trigger(cooldown);
76+
77+
Base.ServerSendPublicRpc(writer =>
78+
{
79+
writer.WriteByte(4);
80+
Base._cackleCooldown.WriteCooldown(writer);
81+
});
82+
83+
foreach (Player player in Player.List)
84+
{
85+
if (Vector3.Distance(player.Position, Owner.Position) <= 5F && player.CurrentItem is not Marshmallow { Evil: true })
86+
player.EnableEffect<TraumatizedByEvil>(duration);
87+
}
88+
}
89+
90+
/// <summary>
91+
/// Makes the owner of this marshmallow evil. You CANNOT undo this without resetting the player.
92+
/// </summary>
93+
/// <param name="evilProcess">The <see cref="AhpStat.AhpProcess"/> of the new evil player.</param>
94+
public void MakeEvil(AhpStat.AhpProcess evilProcess = null)
95+
{
96+
if (Evil)
97+
return;
98+
99+
Base.ReleaseEvil(evilProcess ?? EvilAhpProcess ?? Owner.GetModule<AhpStat>().ServerAddProcess(450F, 450F, 0F, 1F, 0F, true));
100+
}
101+
}
102+
}

EXILED/Exiled.API/Features/Player.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3433,10 +3433,7 @@ public void SyncEffect(Effect effect)
34333433
{
34343434
if (effect.IsEnabled)
34353435
{
3436-
EnableEffect(effect.Type, effect.Duration, effect.AddDurationIfActive);
3437-
3438-
if (effect.Intensity > 0)
3439-
ChangeEffectIntensity(effect.Type, effect.Intensity, effect.Duration);
3436+
EnableEffect(effect.Type, effect.Intensity, effect.Duration, effect.AddDurationIfActive);
34403437
}
34413438
}
34423439

@@ -3564,8 +3561,7 @@ public void ChangeEffectIntensity<T>(byte intensity, float duration = 0)
35643561
{
35653562
if (ReferenceHub.playerEffectsController.TryGetEffect(out T statusEffect))
35663563
{
3567-
statusEffect.Intensity = intensity;
3568-
statusEffect.ServerChangeDuration(duration, true);
3564+
statusEffect.ServerSetState(intensity, duration, false);
35693565
}
35703566
}
35713567

@@ -3579,8 +3575,7 @@ public void ChangeEffectIntensity(EffectType type, byte intensity, float duratio
35793575
{
35803576
if (TryGetEffect(type, out StatusEffectBase statusEffect))
35813577
{
3582-
statusEffect.Intensity = intensity;
3583-
statusEffect.ServerChangeDuration(duration, false);
3578+
statusEffect.ServerSetState(intensity, duration, false);
35843579
}
35853580
}
35863581

0 commit comments

Comments
 (0)