forked from Exiled-Official/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Xmas 2024 from xmas 2023 (#325)
* Scp 559 events (#2345) * lots of new new effects 956 559 * final * fix * idk * Scp956Target * Snowed * doc * scp559 events * comments * fix * Update Exiled.Events/Handlers/Scp559.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/EventArgs/Scp559/SpawningEventArgs.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/EventArgs/Scp559/SpawningEventArgs.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/EventArgs/Scp559/InteractingScp559EventArgs.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/EventArgs/Interfaces/IScp559Event.cs Co-authored-by: Nao <[email protected]> * nao suggestions * fix doc --------- Co-authored-by: Yamato <[email protected]> Co-authored-by: Yamato <[email protected]> Co-authored-by: Nao <[email protected]> * SCP-3114 ragdoll (#2368) * scp 3114 ragdoll * fux * Fix docs --------- Co-authored-by: Nao <[email protected]> * Coffee API (#2360) * coffee api * comments * Fix setter and grammar --------- Co-authored-by: Yamato <[email protected]> Co-authored-by: Nao <[email protected]> * Flamingo respawn event (#2362) * new ev * remove test logs * Update Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/Handlers/Scp1507.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/Handlers/Scp1507.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/Patches/Events/Scp1507/SpawningFlamingos.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/Patches/Events/Scp1507/SpawningFlamingos.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/EventArgs/Scp1507/SpawningFlamingosEventArgs.cs Co-authored-by: Nao <[email protected]> * Update Exiled.Events/Patches/Events/Scp1507/SpawningFlamingos.cs Co-authored-by: Nao <[email protected]> * fix --------- Co-authored-by: Nao <[email protected]> * SpawnReason::ItemUsage * Move File to the new place * Lots of new API (#2342) * lots of new new effects 956 559 * final * fix * idk * Scp956Target * Snowed * doc --------- Co-authored-by: Yamato <[email protected]> * revert * push * Finish Fix build * fix AmbiguousMatchException * FindingPosition Fixed * OpeningGiftEvent * GrantingGift Fix * Fix SpawningFlamingos * DamageType::Scp1507 * DamageType::Scp956 * SnowBall * Fix NPC not spawning * Flamingos * Obsolete Coffee because nw didn't added it in game * patch fixes and optimization * flamingo event to right namespace * or not --------- Co-authored-by: VALERA771 <[email protected]> Co-authored-by: Nao <[email protected]> Co-authored-by: IRacle <[email protected]>
- Loading branch information
1 parent
7c73439
commit 1c7dca4
Showing
39 changed files
with
1,807 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="Coffee.cs" company="ExMod Team"> | ||
// Copyright (c) ExMod Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.API.Features | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using Exiled.API.Extensions; | ||
using Exiled.API.Interfaces; | ||
using UnityEngine; | ||
|
||
using BaseCoffee = global::Coffee; | ||
|
||
/// <summary> | ||
/// A wrapper for coffee cup. | ||
/// </summary> | ||
public class Coffee : IWrapper<BaseCoffee> | ||
{ | ||
/// <summary> | ||
/// Gets the <see cref="Dictionary{TKey,TValue}"/> containing <see cref="BaseCoffee"/> to <see cref="Coffee"/>. | ||
/// </summary> | ||
internal static readonly Dictionary<BaseCoffee, Coffee> BaseToWrapper = new(); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Coffee"/> class. | ||
/// </summary> | ||
/// <param name="coffee"><inheritdoc cref="Base"/></param> | ||
public Coffee(BaseCoffee coffee) | ||
{ | ||
Base = coffee; | ||
|
||
BaseToWrapper.Add(coffee, this); | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets an <see cref="IEnumerable{T}"/> of players who cannot interact with coffee cups. | ||
/// </summary> | ||
public static IEnumerable<Player> BlacklistedPlayers | ||
{ | ||
get => BaseCoffee.BlacklistedPlayers.Select(Player.Get); | ||
set | ||
{ | ||
BaseCoffee.BlacklistedPlayers.Clear(); | ||
|
||
foreach (Player player in value) | ||
BaseCoffee.BlacklistedPlayers.Add(player.ReferenceHub); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Gets the list with all available <see cref="Coffee"/> instanses. | ||
/// </summary> | ||
[Obsolete("This list will be empty")] | ||
public static IReadOnlyCollection<Coffee> List => BaseToWrapper.Values; | ||
|
||
/// <summary> | ||
/// Gets the base coffee instance. | ||
/// </summary> | ||
public BaseCoffee Base { get; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether or not coffee has been drunk. | ||
/// </summary> | ||
public bool IsConsumed | ||
{ | ||
get => Base.IsConsumed; | ||
set => Base.NetworkIsConsumed = value; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets text which will be displayed to player when he drinks coffee. | ||
/// </summary> | ||
public CoffeeTranslation CoffeeTranslation | ||
{ | ||
get => Base._drinkText; | ||
set => Base._drinkText = value; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the author of current <see cref="CoffeeTranslation"/>. | ||
/// </summary> | ||
public string TranslationAuthor | ||
{ | ||
get => Base._author; | ||
set => Base._author = value; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the color of a drink in a cup. | ||
/// </summary> | ||
public Color DrinkColor => Base._drinkColor; | ||
|
||
/// <summary> | ||
/// Gets a <see cref="Coffee"/> given a <see cref="BaseCoffee"/> instance. | ||
/// </summary> | ||
/// <param name="baseCoffee">The <see cref="BaseCoffee"/> instance.</param> | ||
/// <returns>The <see cref="Coffee"/> instance.</returns> | ||
public static Coffee Get(BaseCoffee baseCoffee) => BaseToWrapper.TryGetValue(baseCoffee, out Coffee coffee) ? coffee : new(baseCoffee); | ||
|
||
/// <summary> | ||
/// Gets a <see cref="IEnumerable{T}"/> of <see cref="Coffee"/> matching the condition. | ||
/// </summary> | ||
/// <param name="predicate">The condition to satisfy.</param> | ||
/// <returns>A <see cref="IEnumerable{T}"/> of <see cref="Coffee"/> matching the condition.</returns> | ||
[Obsolete("The respond list will be empty")] | ||
public static IEnumerable<Coffee> Get(Func<Coffee, bool> predicate) => List.Where(predicate); | ||
|
||
/// <summary> | ||
/// Interacts with <see cref="Coffee"/>. | ||
/// </summary> | ||
/// <param name="player">The player who interacts. If <see langword="null"/>, it will be chosen randomly.</param> | ||
public void Interact(Player player = null) => Base.ServerInteract((player ?? Player.Get(x => x.IsHuman).GetRandomValue()).ReferenceHub, byte.MaxValue); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,4 +75,4 @@ public bool IsPlayingAnimation | |
set => Base._playingAnimation = value; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="Scp559.cs" company="ExMod Team"> | ||
// Copyright (c) ExMod Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.API.Features | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
using Exiled.API.Interfaces; | ||
using MapGeneration; | ||
using UnityEngine; | ||
|
||
/// <summary> | ||
/// Represents a cake. | ||
/// </summary> | ||
public class Scp559 : IWrapper<Scp559Cake>, IPosition | ||
{ | ||
/// <summary> | ||
/// <see cref="Dictionary{TKey,TValue}"/> <see cref="Scp559Cake"/> to <see cref="Scp559"/>. | ||
/// </summary> | ||
internal static readonly Dictionary<Scp559Cake, Scp559> CakeToWrapper = new(); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Scp559"/> class. | ||
/// </summary> | ||
/// <param name="cakeBase">The <see cref="Scp559Cake"/> instance.</param> | ||
public Scp559(Scp559Cake cakeBase) | ||
{ | ||
Base = cakeBase; | ||
|
||
CakeToWrapper.Add(cakeBase, this); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the list with all <see cref="Scp559"/> instances. | ||
/// </summary> | ||
public static IReadOnlyCollection<Scp559> List => CakeToWrapper.Values; | ||
|
||
/// <summary> | ||
/// Gets a <see cref="Dictionary{TKey,TValue}"/> with rooms and amount of people in them. | ||
/// </summary> | ||
public static Dictionary<Room, int> PopulatedRooms => Scp559Cake.PopulatedRooms.ToDictionary(x => Room.Get(x.Key), x => x.Value); | ||
|
||
/// <summary> | ||
/// Gets a <see cref="Dictionary{TKey,TValue}"/> with spawnpoint in rooms. | ||
/// </summary> | ||
public static Dictionary<RoomName, Vector4> SpawnPositions => Scp559Cake.Spawnpoints; | ||
|
||
/// <summary> | ||
/// Gets the list of all available spawnpoints. | ||
/// </summary> | ||
public static List<Vector4> AvailableSpawnpoints => Scp559Cake.PossiblePositions; | ||
|
||
/// <summary> | ||
/// Gets or sets offset for spawning near pedestals. | ||
/// </summary> | ||
public static Vector3 PedestalOffset | ||
{ | ||
get => Scp559Cake.PedestalOffset; | ||
set => Scp559Cake.PedestalOffset.Set(value.x, value.y, value.z); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public Scp559Cake Base { get; } | ||
|
||
/// <summary> | ||
/// Gets or sets how many slices are still on cake. | ||
/// </summary> | ||
public byte RemainingSlices | ||
{ | ||
get => Base._remainingSlices; | ||
set => Base.Network_remainingSlices = value; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether or not cake is spawned. | ||
/// </summary> | ||
public bool IsSpawned | ||
{ | ||
get => Base._isSpawned; | ||
set => Base.Network_isSpawned = value; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the time how much cake will still be usable. | ||
/// </summary> | ||
public float RemainingTime | ||
{ | ||
get => Base._remainingTime; | ||
set => Base._remainingTime = value; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the minimum required time for cake to spawn. | ||
/// </summary> | ||
public float RespawnTime | ||
{ | ||
get => Base._respawnTime; | ||
set => Base._respawnTime = value; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public Vector3 Position | ||
{ | ||
get => Base._position; | ||
set => Base.Network_position = value; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the <see cref="Scp559"/> by it's game instance. | ||
/// </summary> | ||
/// <param name="cake">Game instance.</param> | ||
/// <returns><see cref="Scp559"/>.</returns> | ||
public static Scp559 Get(Scp559Cake cake) => CakeToWrapper.TryGetValue(cake, out Scp559 scp559) ? scp559 : new Scp559(cake); | ||
|
||
/// <summary> | ||
/// Gets the <see cref="IEnumerable{T}"/> of SCP-559 which matches the predicate. | ||
/// </summary> | ||
/// <param name="predicate">Predicate to match.</param> | ||
/// <returns><see cref="IEnumerable{T}"/> of SCP-559.</returns> | ||
public static IEnumerable<Scp559> Get(Func<Scp559, bool> predicate) => List.Where(predicate); | ||
|
||
/// <summary> | ||
/// Tries to get available spawn point for SCP-559. | ||
/// </summary> | ||
/// <param name="pos">Position of spawn.</param> | ||
/// <param name="pedestal">Will be pedestal also spawned.</param> | ||
/// <returns><see langword="true"/> if position was found. Otherwise, <see langword="false"/>.</returns> | ||
public bool TryGetSpawnpoint(out Vector3 pos, out bool pedestal) => Base.TryGetSpawnPoint(out pos, out pedestal); | ||
} | ||
} |
Oops, something went wrong.