-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rajout, de la possibilité d'avoir plusieurs Thanos dans une partie. Thanos drop ces pierres à sa mort HUD, La couleurs de Thanos est maintenant violette.
- Loading branch information
Showing
9 changed files
with
205 additions
and
63 deletions.
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
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,88 @@ | ||
using Hazel; | ||
using ModsThanos.Map; | ||
using ModsThanos.Utility; | ||
using UnityEngine; | ||
|
||
namespace ModsThanos.Stone { | ||
public static class StoneDrop { | ||
|
||
public static void tryReplaceStone(string stone) { | ||
if (stone == "Mind" && GlobalVariable.hasMindStone) { | ||
DestroyStone(stone); | ||
Vector2 placement = StonePlacement.GetRandomLocation(stone); | ||
Map.Mind.Place(placement); | ||
GlobalVariable.hasMindStone = false; | ||
|
||
} else if (stone == "Soul" && GlobalVariable.hasSoulStone) { | ||
DestroyStone(stone); | ||
Vector2 placement = StonePlacement.GetRandomLocation(stone); | ||
Map.Soul.Place(placement); | ||
GlobalVariable.hasSoulStone = false; | ||
|
||
GlobalVariable.PlayerSoulStone = null; | ||
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.RemovePlayerSoulStone, SendOption.None, -1); | ||
AmongUsClient.Instance.FinishRpcImmediately(writer); | ||
Player.LocalPlayer.RpcSetColorName(new Color(1f, 1f, 1f, 1f), Player.LocalPlayer.PlayerId); | ||
|
||
} else if (stone == "Power" && GlobalVariable.hasPowerStone) { | ||
DestroyStone(stone); | ||
Vector2 placement = StonePlacement.GetRandomLocation(stone); | ||
Map.Power.Place(placement); | ||
GlobalVariable.hasPowerStone = false; | ||
|
||
} else if (stone == "Time" && GlobalVariable.hasTimeStone) { | ||
DestroyStone(stone); | ||
Vector2 placement = StonePlacement.GetRandomLocation(stone); | ||
Map.Time.Place(placement); | ||
GlobalVariable.hasTimeStone = false; | ||
|
||
} else if (stone == "Space" && GlobalVariable.hasSpaceStone) { | ||
DestroyStone(stone); | ||
Vector2 placement = StonePlacement.GetRandomLocation(stone); | ||
Map.Space.Place(placement); | ||
GlobalVariable.hasSpaceStone = false; | ||
|
||
} else if (stone == "Reality" && GlobalVariable.hasRealityStone) { | ||
DestroyStone(stone); | ||
Vector2 placement = StonePlacement.GetRandomLocation(stone); | ||
Map.Reality.Place(placement); | ||
GlobalVariable.hasRealityStone = false; | ||
} else return; | ||
|
||
ModThanos.Logger.LogInfo($"Send {stone}, Position : {GlobalVariable.stonePositon[stone].x}, {GlobalVariable.stonePositon[stone].y}"); | ||
MessageWriter write = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte) CustomRPC.ReplaceStone, SendOption.None, -1); | ||
write.Write(stone); | ||
write.WriteVector2(GlobalVariable.stonePositon[stone]); | ||
AmongUsClient.Instance.FinishRpcImmediately(write); | ||
} | ||
|
||
public static void ReplaceStone(string stone, Vector2 position) { | ||
DestroyStone(stone); | ||
|
||
if (stone == "Mind") { | ||
Map.Mind.Place(position); | ||
GlobalVariable.hasMindStone = false; | ||
} else if (stone == "Soul") { | ||
Map.Soul.Place(position); | ||
GlobalVariable.hasSoulStone = false; | ||
} else if (stone == "Power") { | ||
Map.Power.Place(position); | ||
GlobalVariable.hasPowerStone = false; | ||
} else if (stone == "Time") { | ||
Map.Time.Place(position); | ||
GlobalVariable.hasTimeStone = false; | ||
} else if (stone == "Space") { | ||
Map.Space.Place(position); | ||
GlobalVariable.hasSpaceStone = false; | ||
} else if (stone == "Reality") { | ||
Map.Reality.Place(position); | ||
GlobalVariable.hasRealityStone = false; | ||
} else return; | ||
} | ||
|
||
public static void DestroyStone(string stone) { | ||
if (GlobalVariable.stoneObjects.ContainsKey(stone)) | ||
GlobalVariable.stoneObjects[stone].DestroyThisObject(); | ||
} | ||
} | ||
} |
Oops, something went wrong.