mirror of
https://git.muiegratis.online/suikoakari/Campofinale
synced 2025-12-12 17:44:37 +01:00
CsSceneRest
This commit is contained in:
@@ -10,21 +10,8 @@ namespace Campofinale.Commands.Handlers
|
||||
[Server.Command("heal", "Revives/Heals your team characters", true)]
|
||||
public static void Handle(Player sender, string cmd, string[] args, Player target)
|
||||
{
|
||||
target.GetCurTeam().ForEach(chara =>
|
||||
{
|
||||
chara.curHp = chara.CalcAttributes()[AttributeType.MaxHp].val;
|
||||
ScCharSyncStatus state = new ScCharSyncStatus()
|
||||
{
|
||||
Objid=chara.guid,
|
||||
IsDead=chara.curHp < 1,
|
||||
BattleInfo = new()
|
||||
{
|
||||
Hp=chara.curHp,
|
||||
Ultimatesp=chara.ultimateSp
|
||||
}
|
||||
};
|
||||
target.Send(ScMsgId.ScCharSyncStatus, state);
|
||||
});
|
||||
target.RestTeam();
|
||||
|
||||
target.Send(ScMsgId.ScSceneRevival, new ScSceneRevival()
|
||||
{
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Campofinale.Game.Factory.BuildingsBehaviour
|
||||
|
||||
producer.lastFormulaId = recipe;
|
||||
producer.progress += craftingRecipe.totalProgress/craftingRecipe.progressRound;
|
||||
currentProgress++;
|
||||
currentProgress++;
|
||||
if (currentProgress >= craftingRecipe.progressRound)
|
||||
{
|
||||
currentProgress = 0;
|
||||
|
||||
28
Campofinale/Packets/Cs/HandleCsSceneRest.cs
Normal file
28
Campofinale/Packets/Cs/HandleCsSceneRest.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Campofinale.Network;
|
||||
using Campofinale.Packets.Sc;
|
||||
using Campofinale.Protocol;
|
||||
using Campofinale.Resource;
|
||||
|
||||
namespace Campofinale.Packets.Cs
|
||||
{
|
||||
public class HandleCsSceneRest
|
||||
{
|
||||
|
||||
[Server.Handler(CsMsgId.CsSceneRest)]
|
||||
public static void Handle(Player session, CsMsgId cmdId, Packet packet)
|
||||
{
|
||||
CsSceneRest req = packet.DecodeBody<CsSceneRest>();
|
||||
|
||||
ScSceneRevival revival = new()
|
||||
{
|
||||
|
||||
};
|
||||
session.RestTeam();
|
||||
session.sceneManager.LoadCurrentTeamEntities();
|
||||
session.Send(ScMsgId.ScSceneRevival, revival, packet.csHead.UpSeqid);
|
||||
session.Send(new PacketScSelfSceneInfo(session, SelfInfoReasonType.SlrReviveRest));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -759,5 +759,24 @@ namespace Campofinale
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RestTeam()
|
||||
{
|
||||
GetCurTeam().ForEach(chara =>
|
||||
{
|
||||
chara.curHp = chara.CalcAttributes()[AttributeType.MaxHp].val;
|
||||
ScCharSyncStatus state = new ScCharSyncStatus()
|
||||
{
|
||||
Objid = chara.guid,
|
||||
IsDead = chara.curHp < 1,
|
||||
BattleInfo = new()
|
||||
{
|
||||
Hp = chara.curHp,
|
||||
Ultimatesp = chara.ultimateSp
|
||||
}
|
||||
};
|
||||
Send(ScMsgId.ScCharSyncStatus, state);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user