![图片[1]软趴趴人类根据地-软趴趴小黑屋-电脑软件-人类一败涂地-资源下载人类一败涂地文件修改源代码(动作录制下载) 不建议小白 -第三章什么!还可以自动空翻!软趴趴人类根据地-软趴趴小黑屋-电脑软件-人类一败涂地-资源下载软趴趴小黑屋](https://img.rlybtd.com/2022/05/20220528091545924.png)
经过一二章节的认识,直接进入主题!不懂可留言!
飞行棋模式 复制粘贴总会吧 不会请看上个章节!
using System;
using System.Collections.Generic;
using Multiplayer;
using UnityEngine;
namespace Public
{
// Token: 0x02000853 RID: 2131
public class AirChess
{
// Token: 0x06002FED RID: 12269 RVA: 0x001519E0 File Offset: 0x0014FBE0
public bool Timer()
{
bool result;
if (DateTime.Now.Second - AirChess.Second_Chess >= 1 || DateTime.Now.Second < AirChess.Second_Chess)
{
AirChess.Second_Chess = DateTime.Now.Second;
result = true;
}
else
{
result = false;
}
return result;
}
// Token: 0x06002FEE RID: 12270 RVA: 0x00145374 File Offset: 0x00143574
public void Private_Message(NetHost netHost, string name, string msg)
{
if (netHost == NetGame.instance.local)
{
NetChat.Print(name);
return;
}
NetStream netStream = NetGame.BeginMessage(NetMsgId.Chat);
try
{
netStream.WriteNetId(netHost.hostId);
netStream.Write(name);
netStream.Write(msg);
if (NetGame.isServer)
{
NetGame.instance.SendReliable(netHost, netStream);
}
}
finally
{
if (netStream != null)
{
netStream = netStream.Release();
}
}
}
// Token: 0x06002FEF RID: 12271 RVA: 0x00020781 File Offset: 0x0001E981
public void Public_Message(string name, string msg)
{
this.Public_Message(0U, name, msg);
}
// Token: 0x06002FF0 RID: 12272 RVA: 0x0008C19C File Offset: 0x0008A39C
public void Public_Message(uint hostID, string name, string msg)
{
NetChat.OnReceive(hostID, name, msg);
NetStream netStream = NetGame.BeginMessage(NetMsgId.Chat);
try
{
netStream.WriteNetId(hostID);
netStream.Write(name);
netStream.Write(msg);
if (NetGame.isServer)
{
for (int i = 0; i < NetGame.instance.readyclients.Count; i++)
{
NetGame.instance.SendReliable(NetGame.instance.readyclients[i], netStream);
}
}
else if (NetGame.instance.server != null && NetGame.instance.server.isReady)
{
NetGame.instance.SendReliableToServer(netStream);
}
}
finally
{
if (netStream != null)
{
netStream = netStream.Release();
}
}
}
// Token: 0x06002FF1 RID: 12273 RVA: 0x00151A30 File Offset: 0x0014FC30
public void Join_Flag(NetHost netHost, string txt)
{
if (string.IsNullOrEmpty(txt))
{
return;
}
string[] array = txt.Split(new char[]
{
' '
}, StringSplitOptions.RemoveEmptyEntries);
int num = 0;
int.TryParse(array[0], out num);
if (num <= 0 || num > 4)
{
this.Private_Message(netHost, "(私发)没有这个阵营,请1-4之间的数字", "");
return;
}
for (int i = 0; i < this.humanList.Count; i++)
{
if (num == this.humanList[i].chessVo.chess_flag)
{
this.Private_Message(netHost, "(私发)已经有人选了这个阵营了", "");
return;
}
}
string[] array2 = new string[]
{
"红方",
"黄方",
"绿方",
"蓝方"
};
if (this.humanList.Contains(netHost.players[0].human))
{
this.humanList.Remove(netHost.players[0].human);
}
netHost.players[0].human.chessVo.chess_flag = num;
this.humanList.Add(netHost.players[0].human);
this.Public_Message(0U, string.Format("<size=22><#{1}>{0}</color></size> <size=22><#FFFFFF>加入了</color></size> <size=22><#{1}>{2}</color></size>", netHost.players[0].host.name, this.color[netHost.players[0].human.chessVo.chess_flag - 1], array2[netHost.players[0].human.chessVo.chess_flag - 1]), "");
}
// Token: 0x06002FF2 RID: 12274 RVA: 0x0002078C File Offset: 0x0001E98C
public static AirChess ins()
{
if (AirChess.instance == null)
{
AirChess.instance = new AirChess();
}
return AirChess.instance;
}
// Token: 0x06002FF3 RID: 12275 RVA: 0x00151BC8 File Offset: 0x0014FDC8
public void AirPrepare()
{
if (AirChess.Airchess_mode)
{
return;
}
AirChess.Prepare = !AirChess.Prepare;
if (AirChess.Prepare)
{
this.Public_Message(0U, string.Format("<size=20><#ECA4F0>飞行棋开启</color></size>", ""), "");
this.Public_Message(0U, string.Format("<size=20><#FFFFFF>请玩家在聊天框输入</color></size> <size=20><#ECA4F0>air 编号</color></size> <size=20><#FFFFFF>来选择阵营,1-4分别是红黄绿蓝</color></size>", ""), "");
return;
}
for (int i = 0; i < Human.all.Count; i++)
{
Human.all[i].chessVo.chess_flag = 0;
Human.all[i].chessVo.chess_step = 0;
Human.all[i].chessVo.chess_turn = false;
Human.all[i].chessVo.chess_turn_use = false;
}
this.humanList.Clear();
this.Public_Message(0U, string.Format("<size=20><#ECA4F0>飞行棋关闭</color></size>", ""), "");
}
// Token: 0x06002FF4 RID: 12276 RVA: 0x00151CBC File Offset: 0x0014FEBC
private void Information(int mode)
{
if (mode == 2)
{
this.Public_Message(0U, string.Format("<size=20><#{1}>{0}</color></size>", this.humanList[AirChess.Turn].player.host.name, this.color[this.humanList[AirChess.Turn].chessVo.chess_flag - 1]) + "<size=20><#FFFFFF>掷出了 </color></size>" + string.Format("<size=22><#FFFFFF>{0}</color></size>", this.humanList[AirChess.Turn].chessVo.chess_step), "");
}
if (mode == 1)
{
this.Public_Message("", " ");
this.Public_Message(0U, "<size=18><#FFFFFF>轮到 </color></size>" + string.Format("<size=20><#{1}>{0}</color></size>", this.humanList[AirChess.Turn].player.host.name, this.color[this.humanList[AirChess.Turn].chessVo.chess_flag - 1]) + " <size=18><#FFFFFF> 掷色子,请在聊天框输入f进行掷色子</color></size>", "");
}
this.humanList[AirChess.Turn].chessVo.chess_step = 0;
if (mode == 3)
{
this.Public_Message(0U, string.Format("<size=22><#{1}>{0}</color></size>", this.humanList[AirChess.Turn].player.host.name, this.color[this.humanList[AirChess.Turn].chessVo.chess_flag - 1]) + "<size=22><#FFFFFF>破天荒的掷出了 </color></size><size=25><#AE54EB> 6 </color></size><size=20><#FFFFFF>!!!请再掷一遍</color></size>", "");
}
}
// Token: 0x06002FF5 RID: 12277 RVA: 0x00151E58 File Offset: 0x00150058
public void AirChessMode()
{
if (this.humanList.Count == 0)
{
this.Public_Message(0U, string.Format("<size=20><#ECA4F0>至少要有一个玩家才能开始游戏</color></size>", ""), "");
return;
}
AirChess.Airchess_mode = !AirChess.Airchess_mode;
AirChess.Turn = 0;
if (!AirChess.Airchess_mode)
{
for (int i = 0; i < Human.all.Count; i++)
{
Human.all[i].chessVo.chess_flag = 0;
Human.all[i].chessVo.chess_step = 0;
Human.all[i].chessVo.chess_turn = false;
Human.all[i].chessVo.chess_turn_use = false;
}
if (this.humanList.Count > 0)
{
this.humanList.Clear();
NetGame.instance.preUpdate -= this.Real_time_refresh;
}
this.Public_Message(0U, string.Format("<size=20><#ECA4F0>房间已关闭飞行棋</color></size>", ""), "");
return;
}
AirChess.Prepare = false;
this.humanList[0].chessVo.chess_turn = true;
AirChess.Turn = 0;
this.Information(1);
this.Public_Message(0U, string.Format("<size=20><#ECA4F0>飞行棋开启</color></size>", ""), "");
NetGame.instance.preUpdate += this.Real_time_refresh;
}
// Token: 0x06002FF6 RID: 12278 RVA: 0x00151FC0 File Offset: 0x001501C0
public void Real_time_refresh()
{
if (this.Timer() && AirChess.Airchess_mode && this.humanList[AirChess.Turn].chessVo.chess_turn_use)
{
this.humanList[AirChess.Turn].chessVo.chess_turn_use = false;
int chess_step = (UnityEngine.Random.Range(100, 699) + new System.Random().Next(100, 699) + UnityEngine.Random.Range(100, 699)) / 300;
this.humanList[AirChess.Turn].chessVo.chess_step = chess_step;
if (this.humanList[AirChess.Turn].chessVo.chess_step == 6)
{
this.Information(3);
this.Information(1);
return;
}
this.Information(2);
this.humanList[AirChess.Turn].chessVo.chess_turn = false;
AirChess.Turn++;
if (AirChess.Turn >= this.humanList.Count)
{
AirChess.Turn = 0;
}
this.humanList[AirChess.Turn].chessVo.chess_turn = true;
this.Information(1);
}
}
// Token: 0x06002FF7 RID: 12279 RVA: 0x00152100 File Offset: 0x00150300
public void AirChess_Command()
{
Shell.RegisterCommand("飞行棋准备", new Action(this.AirPrepare), null);
Shell.RegisterCommand("飞行棋", new Action(this.AirChessMode), null);
NetChat.RegisterCommand(true, false, "飞行棋准备", new Action(this.AirPrepare), null);
NetChat.RegisterCommand(true, false, "飞行棋", new Action(this.AirChessMode), null);
}
// Token: 0x06002FF8 RID: 12280 RVA: 0x000202EC File Offset: 0x0001E4EC
public static void InviteFriend()
{
if (App.state == AppSate.ClientLobby || App.state == AppSate.ClientPlayLevel || App.state == AppSate.ServerLobby || App.state == AppSate.ServerPlayLevel)
{
NetGame.instance.transport.SendInvite();
}
}
// Token: 0x04002FC4 RID: 12228
public static bool Airchess_mode;
// Token: 0x04002FC5 RID: 12229
private string[] color = new string[]
{
"F99898",
"FDF487",
"B6FD87",
"87FAFD"
};
// Token: 0x04002FC6 RID: 12230
public List<Human> humanList = new List<Human>();
// Token: 0x04002FC7 RID: 12231
public static AirChess instance;
// Token: 0x04002FC8 RID: 12232
public static bool Prepare;
// Token: 0x04002FC9 RID: 12233
public static int Second_Chess;
// Token: 0x04002FCA RID: 12234
public static int Turn;
}
}
拳击代码
public void Boxing_Command()
{
NetChat.RegisterCommand(true, false, "拳击大赛", new Action<string>(this.Quanjidasai), null);
NetChat.RegisterCommand(true, false, "enquanji", new Action<string>(this.enQuanJi), null);
Shell.RegisterCommand("enquanji", new Action<string>(this.enQuanJi), null);
}
© 版权声明
THE END


































- 最新
- 最热
只看作者