Skip to content

Commit 42e3254

Browse files
committed
Merge branch 'develop'
2 parents babd858 + b8c8602 commit 42e3254

File tree

11 files changed

+82
-101
lines changed

11 files changed

+82
-101
lines changed

ExtremeRoles/ExtremeRoles.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<TargetFramework>net6.0</TargetFramework>
44
<LangVersion>latest</LangVersion>
55
<WarningLevel>7</WarningLevel>
6-
<!--<Version>10.0.0.0</Version>-->
7-
<VersionPrefix>10.0.0</VersionPrefix>
6+
<Version>10.0.0.1</Version>
7+
<!--<VersionPrefix>10.0.0</VersionPrefix>-->
88
<VersionSuffix>AmongUsV2024305</VersionSuffix>
99
<Description>Extreme Roles for Advanced user</Description>
1010
<Authors>yukieiji</Authors>

ExtremeRoles/Helper/GameSystem.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,27 @@ public static void AddSpawnPoint(in List<Vector2> pos, in byte playerId)
205205
}
206206
}
207207

208+
public static ArrowBehaviour GetArrowTemplate()
209+
{
210+
ArrowBehaviour? template = null;
211+
212+
foreach (var task in CachedShipStatus.Instance.SpecialTasks)
213+
{
214+
if (!task.IsTryCast<SabotageTask>(out var saboTask) ||
215+
saboTask!.Arrows.Count == 0)
216+
{
217+
continue;
218+
}
219+
template = saboTask!.Arrows[0];
220+
break;
221+
}
222+
if (template == null)
223+
{
224+
throw new ArgumentNullException("Arrow is Null!!");
225+
}
226+
return template;
227+
}
228+
208229
public static ShipStatus GetShipObj(byte mapId)
209230
{
210231
byte optionMapId = GameOptionsManager.Instance.CurrentGameOptions.GetByte(

ExtremeRoles/Module/Arrow.cs

Lines changed: 53 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,78 @@
11
using UnityEngine;
22

3-
using ExtremeRoles.Module.CustomMonoBehaviour;
3+
using ExtremeRoles.Helper;
44

5-
namespace ExtremeRoles.Module
5+
namespace ExtremeRoles.Module;
6+
7+
#nullable enable
8+
9+
public sealed class Arrow
610
{
11+
public GameObject Main
12+
{
13+
get => this.arrowBehaviour.gameObject;
14+
}
15+
16+
public Vector3 Target { get; private set; }
17+
18+
private readonly ArrowBehaviour arrowBehaviour;
19+
private static readonly Vector3 defaultPos = new Vector3(100.0f, 100.0f, 100.0f);
20+
private static ArrowBehaviour? arrow = null;
721

8-
public sealed class Arrow
22+
public Arrow(Color color)
923
{
10-
public GameObject Main
24+
if (arrow == null)
1125
{
12-
get => this.body;
26+
arrow = GameSystem.GetArrowTemplate();
1327
}
1428

15-
public Vector3 Target { get; private set; }
29+
this.arrowBehaviour = Object.Instantiate(arrow);
30+
this.arrowBehaviour.gameObject.SetActive(true);
31+
this.arrowBehaviour.image.color = color;
32+
this.arrowBehaviour.MaxScale = 0.75f;
1633

17-
private const float xzMaxSize = 0.4f;
18-
private const float yMaxSize = 0.525f;
19-
20-
private GameObject body;
21-
private SpriteRenderer image;
22-
private ArrowBehaviour arrowBehaviour;
23-
private static readonly Vector3 defaultPos = new Vector3(100.0f, 100.0f, 100.0f);
34+
this.Target = defaultPos;
35+
}
2436

25-
public Arrow(Color color)
37+
public void Update()
38+
{
39+
if (this.Target == defaultPos)
2640
{
27-
this.body = new GameObject("Arrow");
28-
29-
this.body.layer = 5;
30-
this.image = this.body.AddComponent<SpriteRenderer>();
31-
32-
if (Prefab.Arrow != null)
33-
{
34-
this.image.sprite = Prefab.Arrow;
35-
}
36-
this.image.color = color;
37-
this.arrowBehaviour = this.body.AddComponent<ArrowBehaviour>();
38-
this.arrowBehaviour.image = this.image;
39-
40-
Resizeer resizer = this.body.AddComponent<Resizeer>();
41-
resizer.SetScale(xzMaxSize, yMaxSize, xzMaxSize);
42-
this.Target = defaultPos;
41+
this.Target = Vector3.zero;
4342
}
43+
UpdateTarget();
44+
}
4445

45-
public void Update()
46+
public void SetColor(Color? color = null)
47+
{
48+
if (color.HasValue)
4649
{
47-
if (Prefab.Arrow != null && this.image == null)
48-
{
49-
this.image.sprite = Prefab.Arrow;
50-
}
51-
if (this.Target == defaultPos)
52-
{
53-
this.Target = Vector3.zero;
54-
}
55-
UpdateTarget();
50+
this.arrowBehaviour.image.color = color.Value;
5651
}
52+
}
5753

58-
public void SetColor(Color? color = null)
54+
public void UpdateTarget(Vector3? target = null)
55+
{
56+
if (this.arrowBehaviour == null) { return; }
57+
58+
if (target.HasValue)
5959
{
60-
if (color.HasValue) { this.image.color = color.Value; };
60+
this.Target = target.Value;
6161
}
6262

63-
public void UpdateTarget(Vector3? target = null)
64-
{
65-
if (this.body == null) { return; }
63+
this.arrowBehaviour.target = this.Target;
64+
}
6665

67-
if (target.HasValue)
68-
{
69-
this.Target = target.Value;
70-
}
66+
public void Clear()
67+
{
68+
if (this.arrowBehaviour == null) { return; }
7169

72-
this.arrowBehaviour.target = this.Target;
73-
this.arrowBehaviour.Update();
74-
}
70+
Object.Destroy(this.arrowBehaviour);
71+
}
72+
public void SetActive(bool active)
73+
{
74+
if (this.arrowBehaviour == null) { return; }
7575

76-
public void Clear()
77-
{
78-
Object.Destroy(this.body);
79-
}
80-
public void SetActive(bool active)
81-
{
82-
if (this.body != null)
83-
{
84-
this.body.SetActive(active);
85-
}
86-
}
76+
this.arrowBehaviour.gameObject.SetActive(active);
8777
}
8878
}

ExtremeRoles/Module/CustomMonoBehaviour/ExtremeConsole.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010

1111
namespace ExtremeRoles.Module.CustomMonoBehaviour;
1212

13-
[Il2CppRegister(
14-
new Type[]
15-
{
16-
typeof(IUsable)
17-
})]
13+
[Il2CppRegister([ typeof(IUsable) ])]
1814
public sealed class ExtremeConsole : MonoBehaviour, IAmongUs.IUsable
1915
{
2016
public interface IBehavior

ExtremeRoles/Module/CustomMonoBehaviour/ExtremePlayerTask.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,6 @@ public interface IBehavior
2929
public void OnRemove();
3030
public void OnComplete();
3131

32-
protected static ArrowBehaviour GetArrowTemplate()
33-
{
34-
ArrowBehaviour? template = null;
35-
36-
foreach (var task in CachedShipStatus.Instance.SpecialTasks)
37-
{
38-
if (!task.IsTryCast<SabotageTask>(out var saboTask) ||
39-
saboTask!.Arrows.Count == 0)
40-
{
41-
continue;
42-
}
43-
template = saboTask!.Arrows[0];
44-
break;
45-
}
46-
if (template == null)
47-
{
48-
throw new ArgumentNullException("Arrow is Null!!");
49-
}
50-
return template;
51-
}
52-
5332
protected static void CloseMinigame<T>() where T : Minigame
5433
{
5534
if (Minigame.Instance.IsTryCast<T>(out var targetMinigame) &&

ExtremeRoles/Module/Prefab.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ namespace ExtremeRoles.Module;
55

66
public static class Prefab
77
{
8-
public static Sprite Arrow;
98
public static TextMeshPro Text;
109
public static GenericPopup Prop;
1110
public static PoolablePlayer PlayerPrefab;

ExtremeRoles/Module/SystemType/Roles/TeroristTeroSabotageSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void Initialize(PlayerControl owner, Transform transform)
157157
{
158158
if (owner == null || !owner.AmOwner) { return; }
159159

160-
ArrowBehaviour arrow = ExtremePlayerTask.IBehavior.GetArrowTemplate();
160+
ArrowBehaviour arrow = GameSystem.GetArrowTemplate();
161161

162162
foreach (var (index, console) in this.system.setBomb)
163163
{

ExtremeRoles/Patches/Manager/GameStartManagerPatch.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ public static void StartPrefix(GameStartManager __instance)
125125
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Start))]
126126
public static void StartPostfix(GameStartManager __instance)
127127
{
128-
if (Module.Prefab.Arrow == null)
129-
{
130-
Module.Prefab.Arrow = __instance.StartButton.sprite;
131-
}
132128
updateText(__instance, DataManager.Settings.Gameplay.StreamerMode);
133129
}
134130

ExtremeRoles/Roles/Combination/HeroAcademia.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public AllPlayerArrows(byte rolePlayerId)
4545

4646
var text = GameObject.Instantiate(
4747
Prefab.Text, playerArrow.Main.transform);
48-
text.fontSize = text.fontSizeMax = text.fontSizeMin = 3.8f;
48+
text.fontSize = text.fontSizeMax = text.fontSizeMin = 3.25f;
4949
Object.Destroy(text.fontMaterial);
5050
text.fontMaterial = UnityEngine.Object.Instantiate(
5151
FastDestroyableSingleton<HudManager>.Instance.UseButton.buttonLabelText.fontMaterial,

ExtremeSkins/ExtremeSkins.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<TargetFramework>net6.0</TargetFramework>
44
<LangVersion>latest</LangVersion>
55
<WarningLevel>7</WarningLevel>
6-
<!--<Version>9.0.0.0</Version>-->
7-
<VersionPrefix>9.0.0</VersionPrefix>
6+
<Version>9.0.0.1</Version>
7+
<!--<VersionPrefix>9.0.0</VersionPrefix>-->
88
<VersionSuffix>AmongUsV2024305</VersionSuffix>
99
<Description>Extreme Skins for Extreme Roles</Description>
1010
<Authors>yukieiji</Authors>

ExtremeVoiceEngine/ExtremeVoiceEngine.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net6.0</TargetFramework>
55
<LangVersion>latest</LangVersion>
66
<WarningLevel>7</WarningLevel>
7-
<Version>2.0.0.51</Version>
7+
<Version>2.0.0.52</Version>
88
<!--<VersionPrefix>2.0.0</VersionPrefix>-->
99
<VersionSuffix>AmongUsV20230711</VersionSuffix>
1010
<Description>Extreme Voice Engine for bridging Extreme Roles and Voice Engine</Description>

0 commit comments

Comments
 (0)