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

Feature/jClient #1289

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
1 change: 1 addition & 0 deletions Patches/CheckGameEndPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public bool CheckGameEndByLivingPlayers(out GameOverReason reason)
reason = GameOverReason.ImpostorByKill;
CustomWinnerHolder.ResetAndSetWinner(CustomWinner.Jackal);
CustomWinnerHolder.WinnerRoles.Add(CustomRoles.Jackal);
CustomWinnerHolder.WinnerRoles.Add(CustomRoles.JClient);
CustomWinnerHolder.WinnerRoles.Add(CustomRoles.JSchrodingerCat);
}
else if (Jackal == 0 && Imp == 0) //クルー勝利
Expand Down
1 change: 1 addition & 0 deletions Patches/IntroPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public static void Postfix(IntroCutscene __instance, ref Il2CppSystem.Collection
{
CustomRoles.Egoist => GetString("TeamEgoist"),
CustomRoles.Jackal => GetString("TeamJackal"),
CustomRoles.JClient => GetString("TeamJackal"),
_ => GetString("NeutralInfo"),
};
__instance.BackgroundBar.material.color = Utils.GetRoleColor(role);
Expand Down
23 changes: 23 additions & 0 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,29 @@ To douse, you must stand next to a player after pressing kill until the orange t
| Arsonist Douse Duration |
| Arsonist Douse Cooldown |

### Client

Create and idea by くろにゃんこ<br>

Team : Neutral(Jackal)<br>
Basis : Crewmate or Engineer<br>
Hyz-sui marked this conversation as resolved.
Show resolved Hide resolved

The Client belong to team Jackal, like Inpostor's Madmates.<br>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文脈的にここのインポスターは複数だと思うのでImpostors' Madmatesが正しいと思いますが,別にインポスターがマッドメイトを所有しているわけではないのでMadmates for Impostors(インポスターにとってのマッドメイトのように,...)あたりが適切に思います

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

翻訳系は全般的に見直します

They can see who is the Jackal after finishing all their tasks.<br>
Depending on option, they can use vents.<br>

### Game Options

| Name |
| ---------------------------------------- |
| Client Can Use Vent |
| Client Vent Cooldown |
| Client Max Time In Vents (s) |
| Client Tasks |
| Client Have Impostor Vision |
| Can see task finished Client from Jackal |
| After Jackal Dead Mode |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全角スペースが混ざっているのと,翻訳とオプション名がズレているのをなんとかしてほしいです

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正します


### Egoist

Create by そうくん<br>
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,28 @@ Polus や The Airship のドアを開けるとその部屋の全てのドアが
| 塗り時間 |
| クールダウン |

### Client/クライアント

制作・考案者 : くろにゃんこ<br>

陣営 : ニュートラル(ジャッカル)<br>
判定 : クルーメイトorエンジニア<br>
Hyz-sui marked this conversation as resolved.
Show resolved Hide resolved

ジャッカル陣営に属しますが、クライアントとジャッカルはお互い誰かはわかりません。<br>
タスクを全て完了させるとジャッカルを認識できるようになります。<br>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

日英のreadmeで情報量にかなり差があるようですが,何かそうした理由はありますか?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

翻訳系は全般的に見直します


#### 設定

| 設定名 |
| ------------------------------------------ |
| ベントを使用できる |
| ベントクールダウン |
| ベント内での最大時間 |
| クライアントのタスク数 |
| インポスターと同じ視界を持つ |
| タスクが終わるとジャッカルからも視認できる |
| ジャッカル死亡後のモード |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

翻訳とオプション名がズレているのをなんとかしてほしいです

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README修正します


### Egoist/エゴイスト

考案者 : しゅー<br>
Expand Down
10 changes: 10 additions & 0 deletions Resources/string.csv
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"Egoist","Egoist","エゴイスト","野心家","利己主義者","Эгоист","Egoísta"
"Lovers","Lovers","恋人","恋人","戀人","Любовники","Amantes"
"Jackal","Jackal","ジャッカル","豺狼","豺狼","Шакал","Chacal"
"JClient","Client","クライアント",,,,

"# HideAndSeek"
"HASFox","Fox","狐","狐狸","狐妖","Лис","Raposa"
Expand Down Expand Up @@ -144,6 +145,7 @@
"EgoistInfo","Take over the Impostors' victory","インポスター勝利を独占しよう","夺走内鬼的胜利","讓我們來奪取偽裝者的勝利","Не дай Предателям победить","Ganhe no lugar do Impostor"
"LoversInfo","Live happily ever after, together","恋人と生きて幸せを掴もう","你们坠入了爱河,成为了一对恋人,一起活到最后吧!","你墜入了愛河","Выживите со своим Любовником","Vivam felizes para sempre, juntos"
"JackalInfo","Kill Everyone","すべてを殺せ","快去杀光所有人,一只苍蝇都不要剩下!","殺光所有人不留活口","Убей всех игроков","Mate todos"
"JClientInfo","Finish your tasks to help the Jackal","タスクを済ませ、ジャッカルの援助をしよう",,,,

"# HideAndSeek"
"HASFoxInfo","Just stay alive","とにかく生き残りましょう","活下去吧!活到最后你就成为了赢家!","盡你所能地活下去吧!","Останьтесь в живых","Sobreviva a qualquer custo"
Expand Down Expand Up @@ -204,6 +206,7 @@
"OpportunistInfoLong","(Neutrals):\nSo long as you are alive at the end of the game, you will win alongside whoever the victor is.","(ニュートラル):\n試合終了時に生存していれば追加勝利となる。","(独立阵营):\n若投机者在游戏结束时存活,则投机者跟随获胜玩家一同获得胜利。","(中立):\n如果投機主義者活到最後,他將跟著遊戲結束獲勝的陣營一起獲勝。","(Нейтрал):\nВыживший выигрывает игру с любыми другими ролями, но только если он выжил.","(Neutros): \nContanto que você esteja vivo no final do jogo, você dividirá a vitória ao lado do vencedor."
"EgoistInfoLong","(Neutrals):\nWhen all impostors are dead, you solo victory by fulfilling impostor victory conditions.\nYou and the impostors know who each other are.","(ニュートラル):\n味方がすべて死んだ状態でインポスターが勝つと単独勝利する。\nインポスターは誰がエゴイストか分かる。エゴイストも、誰がインポスターか分かる。","(独立阵营):\n原则上野心家属于内鬼阵营。野心家与内鬼阵营玩家互认但不可以击杀对方。\n当其他内鬼阵营玩家全部死亡后,若野心家存活且内鬼阵营达成胜利条件,则野心家单独获得胜利。","(中立陣營):\n如果所有的偽裝者都死亡,且利己主義者存活,利己主義者將獨自獲勝。\n(偽裝者和利己主義者互相知道對方但是不可以互刀對方)","(Нейтрал):\nПосле того, как все Предатели умрут то Эгоист побеждает вместо Предателей. \nПредатели и Эгоист видят друг друга.","(Neutros): \nQuando todos os Impostores morrerem, você ganha sozinho assumindo o papel de Impostor. \nVocê e os Impostores sabem quem são uns aos outros."
"JackalInfoLong","(Neutrals):\nJackal can kill all Crewmates, Impostors and Neutrals.\nTeam Jackal wins when living Jackal outnumbers living Crewmates and when there are no Impostors alive.","(ニュートラル):\nジャッカルはすべてのプレイヤーを殺すことができる。\nインポスターが残っておらず、生き残っているジャッカルの人数がクルーと同じかそれ以上でジャッカルが勝利する。","(独立阵营):\n豺狼需要击杀所有人。\n存活的玩家只剩豺狼和一名其他船员时,豺狼获得胜利。","(中立):\n豺狼需要殺死所有人來獲得勝利,\n如果場上存活的玩家只剩下豺狼和另一名不帶刀職業時,豺狼將獲勝。","(Нейтрал):\nШакал может убить всех Членов Экипажа, Нейтралов и Предателей тоже. \nШакал может победить, когда в живых остался только 1 Шакал и 1 Член Экипажа.","(Neutros): \nVocê pode matar todos os jogadores. \nGanhe quando não existirem mais Impostores, e o número de Chacais for maior que o de Tripulantes."
"JClientInfoLong","(Neutrals):\nCrewmate, but they belong to team Jackal, one type of Jackal's Madmates.\nThey can see who is the Jackal after finishing all their tasks.\nDepending on option, they can use vents.","(ジャッカル陣営):\nクルーだがジャッカルの味方をする。\nジャッカルと互いに認識できないが、タスクを全て完了させるとジャッカルを認識できるようになる。",,,,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらもreadmeと同様です

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

合せて修正します


"# HideAndSeek"
"HASFoxInfoLong","(HideAndSeek):\nThey win the game with other Roles (except Troll) only if they are alive at the game end.","(かくれんぼ):\nトロールを除くいずれかの陣営が勝利したときに生き残っていれば、勝利した陣営に追加で勝利することができる。","(躲猫猫):\n狐狸活到最后便与获胜阵营一同获胜。","(躲貓貓):\n除了其他的中立陣營以外,只要狐妖活下來即可獲勝\n他們將跟著遊戲結束的獲勝陣營一起獲勝。","(Прятки):\nЕсли какая-либо роль, кроме Тролля побеждает и выживает, то победившая роль может одержать дополнительную победу.","(Esconde-Esconde): \nEles ganham adicionalmente com qualquer classe (exceto Troll), se estiverem vivos no final."
Expand Down Expand Up @@ -429,6 +432,13 @@
"AssignOnlyTo%role%","Assign Only To %role%","%role%のみに割り当てる","只赋予%role%","","Назначить только для %role%",""
"WorkhorseNumLongTasks","Additional Long Tasks","追加ロングタスクの個数","额外长任务数","增加的長任務數量","Дополнительные долгие задания",""
"WorkhorseNumShortTasks","Additional Short Tasks","追加ショートタスクの個数","额外短任务数","增加的短任務數量","Дополнительные короткие задания",""
"JClientCanVent","Client Can Vent","クライアントがベントを使える",,,,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

共通の翻訳を使ってほしいです

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OptionName⇒GeneralOptionを使用して共通にします。

"JClientVentCooldown","Client Vent Cooldown","クライアントのベントクールダウン",,,,
"JClientVentMaxTime","Client Max Time In Vents(s)","クライアントのベント内での最大時間",,,,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

フォーマットをSecondsに設定するのでここの(s)は不要だと思います

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

単位を省きます

"JClientCanAlsoBeExposedToJackal","Client Also Exposed To Jackal","クライアントがジャッカルからも視認できる",,,,
"JClientAfterJackalDead","Client Mode After Jackal Dead","クライアントのジャッカル死亡後モード",,,,
"JClientAfterJackalDeadMode.None","None","なし",,,,
"JClientAfterJackalDeadMode.Following","Following","後追い",,,,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

欠落している部分の書き方を他の翻訳に合わせてほしいです

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

日英以外の翻訳部分でしょうか?
合せられるところは記載します

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そうですね、他と同じように空文字列のようにしてほしいです

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

翻訳できない部分は空文字にします


"## かくれんぼ設定"
"HideAndSeekOptions","Hide and Seek Settings","かくれんぼの設定","躲猫猫设置","躲貓貓設定","Настройки Пряток","Configurações do Esconde-Esconde"
Expand Down
1 change: 1 addition & 0 deletions Roles/Core/CustomRoleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ public enum CustomRoles
Executioner,
Jackal,
JSchrodingerCat,//ジャッカル陣営のシュレディンガーの猫
JClient,
//HideAndSeek
HASFox,
HASTroll,
Expand Down
133 changes: 133 additions & 0 deletions Roles/Neutral/JClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
using System.Linq;
using AmongUs.GameOptions;

using TownOfHost.Roles.Core;

namespace TownOfHost.Roles.Neutral;
public sealed class JClient : RoleBase
{
public static readonly SimpleRoleInfo RoleInfo =
SimpleRoleInfo.Create(
typeof(JClient),
player => new JClient(player),
CustomRoles.JClient,
() => OptionCanVent.GetBool() ? RoleTypes.Engineer : RoleTypes.Crewmate,
CustomRoleTypes.Neutral,
51000,
SetupOptionItem,
"jcl",
"#00b4eb",
introSound: () => GetIntroSound(RoleTypes.Impostor)
);
public JClient(PlayerControl player)
: base(
RoleInfo,
player,
() => HasTask.ForRecompute)
{
CanVent = OptionCanVent.GetBool();
VentCooldown = OptionVentCooldown.GetFloat();
VentMaxTime = OptionVentMaxTime.GetFloat();
HasImpostorVision = OptionHasImpostorVision.GetBool();
CanAlsoBeExposedToJackal = OptionCanAlsoBeExposedToJackal.GetBool();
AfterJackalDead = (AfterJackalDeadMode)OptionAfterJackalDead.GetValue();

CustomRoleManager.MarkOthers.Add(GetMarkOthers);
}

private static OptionItem OptionCanVent;
private static OptionItem OptionVentCooldown;
private static OptionItem OptionVentMaxTime;
private static OptionItem OptionHasImpostorVision;
private static OptionItem OptionCanAlsoBeExposedToJackal;
private static OptionItem OptionAfterJackalDead;
private static Options.OverrideTasksData Tasks;
enum OptionName
{
JClientCanVent,
JClientVentCooldown,
JClientVentMaxTime,
JClientCanAlsoBeExposedToJackal,
JClientAfterJackalDead
}

private static bool CanVent;
private static float VentCooldown;
private static float VentMaxTime;
private static bool HasImpostorVision;
private static bool CanAlsoBeExposedToJackal;
private static AfterJackalDeadMode AfterJackalDead;
private static void SetupOptionItem()
{
OptionCanVent = BooleanOptionItem.Create(RoleInfo, 10, OptionName.JClientCanVent, false, false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ベント可否は一般オプションにあるのでそちらを使ってほしいです

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GeneralOptionを使用します

OptionVentCooldown = FloatOptionItem.Create(RoleInfo, 11, OptionName.JClientVentCooldown, new(0f, 180f, 5f), 0f, false)
.SetValueFormat(OptionFormat.Seconds);
OptionVentMaxTime = FloatOptionItem.Create(RoleInfo, 12, OptionName.JClientVentMaxTime, new(0f, 180f, 5f), 0f, false)
.SetValueFormat(OptionFormat.Seconds);
// 20-23を使用
Tasks = Options.OverrideTasksData.Create(RoleInfo, 20);
OptionHasImpostorVision = BooleanOptionItem.Create(RoleInfo, 30, GeneralOption.ImpostorVision, false, false);
OptionCanAlsoBeExposedToJackal = BooleanOptionItem.Create(RoleInfo, 31, OptionName.JClientCanAlsoBeExposedToJackal, false, false);
OptionAfterJackalDead = StringOptionItem.Create(RoleInfo, 32, OptionName.JClientAfterJackalDead, AfterJackalDeadModeText, 0, false);
}

private enum AfterJackalDeadMode
{
None,
Following
};
private static readonly string[] AfterJackalDeadModeText =
{
"JClientAfterJackalDeadMode.None",
"JClientAfterJackalDeadMode.Following"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

インデントに違和感がありますが,なにか理由はありますか?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不備です。インデント揃えます。

};
public override void ApplyGameOptions(IGameOptions opt)
{
AURoleOptions.EngineerCooldown = JClient.VentCooldown;
AURoleOptions.EngineerInVentMaxTime = JClient.VentMaxTime;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JClient.が冗長です

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正します。

opt.SetVision(HasImpostorVision);
}
private bool KnowsJackal() => IsTaskFinished;
public override bool OnCompleteTask()
{
if (KnowsJackal())
{
foreach (var jackal in Main.AllPlayerControls.Where(player => player.Is(CustomRoles.Jackal)).ToArray())
{
NameColorManager.Add(Player.PlayerId, jackal.PlayerId, jackal.GetRoleColorCode());
}
}
return true;
}
private static string GetMarkOthers(PlayerControl seer, PlayerControl seen = null, bool isForMeeting = false)
{
seen ??= seer;
if (!CanAlsoBeExposedToJackal ||
!seer.Is(CustomRoles.Jackal) || seen.GetRoleClass() is not JClient jclient ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特別な事情がなければキャメルケースで命名してほしいです

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jclient ⇒ jClient の指摘でよかったでしょうか?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そんな感じです
それかシンプルにclientでもいいと思います

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clientで統一したいと思います

!jclient.KnowsJackal())
{
return string.Empty;
}

return Utils.ColorString(Utils.GetRoleColor(CustomRoles.JClient), "★");
}
public override void AfterMeetingTasks()
{
//ジャッカル死亡時のクライアント状態変化
if (AfterJackalDead == AfterJackalDeadMode.None) return;

var jackal = Main.AllPlayerControls.ToArray().Where(pc => pc.Is(CustomRoles.Jackal)).FirstOrDefault();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToArrayはないほうがいいと思います

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

処理冗長ですね。修正します。

if (jackal != null && !jackal.Data.IsDead &&
!Main.AfterMeetingDeathPlayers.ContainsKey(jackal.PlayerId)) return;

Logger.Info($"jackal:dead, mode:{AfterJackalDead}", "JClient.AfterMeetingTasks");

if (Player.Data.IsDead || !MyTaskState.IsTaskFinished) return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsAliveではなくIsDeadを使っている理由はありますか?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

旧処理の修正漏れです。IsAlive使用します。


if (AfterJackalDead == AfterJackalDeadMode.Following)
{
Main.AfterMeetingDeathPlayers.TryAdd(Player.PlayerId, CustomDeathReason.FollowingSuicide);
Logger.Info($"followingDead set:{Player.name}", "JClient.AfterMeetingTasks");
}
}
}