mirror of
https://git.muiegratis.online/suikoakari/Campofinale
synced 2025-12-12 09:34:34 +01:00
cleaning code
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Campofinale.Game.Factory
|
||||
{
|
||||
public class BlockCalculator
|
||||
{
|
||||
public static float CalculateTotalBlocks(List<Vector3f> points)
|
||||
public static int CalculateTotalBlocks(List<Vector3f> points)
|
||||
{
|
||||
if (points == null || points.Count < 2)
|
||||
return 0;
|
||||
@@ -36,7 +36,6 @@ namespace Campofinale.Game.Factory
|
||||
int y1 = (int)Math.Floor(p2.y);
|
||||
int z1 = (int)Math.Floor(p2.z);
|
||||
|
||||
// Algoritmo di Bresenham 3D
|
||||
int dx = Math.Abs(x1 - x0);
|
||||
int dy = Math.Abs(y1 - y0);
|
||||
int dz = Math.Abs(z1 - z0);
|
||||
@@ -44,7 +43,6 @@ namespace Campofinale.Game.Factory
|
||||
int sy = y0 < y1 ? 1 : -1;
|
||||
int sz = z0 < z1 ? 1 : -1;
|
||||
|
||||
// Decision variables
|
||||
if (dx >= dy && dx >= dz)
|
||||
{
|
||||
int err1 = 2 * dy - dx;
|
||||
@@ -89,7 +87,7 @@ namespace Campofinale.Game.Factory
|
||||
y0 += sy;
|
||||
}
|
||||
}
|
||||
else // dz è la dimensione dominante
|
||||
else
|
||||
{
|
||||
int err1 = 2 * dy - dz;
|
||||
int err2 = 2 * dx - dz;
|
||||
@@ -112,7 +110,6 @@ namespace Campofinale.Game.Factory
|
||||
}
|
||||
}
|
||||
|
||||
// Aggiungi l'ultimo punto
|
||||
blocks.Add(Tuple.Create(x1, y1, z1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,10 +76,9 @@ namespace Campofinale.Game.Factory
|
||||
List<FactoryNode> nodeUpdateList = new();
|
||||
foreach (var node in GetChapter(player.GetCurrentChapter()).nodes)
|
||||
{
|
||||
|
||||
if (node != null)
|
||||
{
|
||||
if (node.position.DistanceXZ(player.position) < 150 && node.nodeType != FCNodeType.BoxConveyor)
|
||||
if (node.position.DistanceXZ(player.position) < 150 && node.nodeBehaviour!=null)
|
||||
{
|
||||
nodeUpdateList.Add(node);
|
||||
}
|
||||
|
||||
@@ -140,14 +140,15 @@ namespace Campofinale.Game.Inventory
|
||||
Inst = new()
|
||||
{
|
||||
InstId = guid,
|
||||
|
||||
|
||||
Equip = new()
|
||||
{
|
||||
|
||||
|
||||
EquipCharId = GetOwner().chars.Find(c => c.IsEquipped(guid)) != null ? GetOwner().chars.Find(c => c.IsEquipped(guid)).guid : 0,
|
||||
Equipid = guid,
|
||||
Templateid = ResourceManager.GetItemTemplateId(id),
|
||||
|
||||
|
||||
},
|
||||
IsLock = locked
|
||||
}
|
||||
@@ -240,6 +241,7 @@ namespace Campofinale.Game.Inventory
|
||||
|
||||
};
|
||||
GetOwner().Send(ScMsgId.ScWeaponAddExp, levelUp);
|
||||
|
||||
GetOwner().Send(new PacketScSyncWallet(GetOwner()));
|
||||
}
|
||||
}
|
||||
@@ -257,6 +259,10 @@ namespace Campofinale.Game.Inventory
|
||||
return false;
|
||||
case ItemValuableDepotType.MissionItem:
|
||||
return true;
|
||||
case ItemValuableDepotType.Factory:
|
||||
return false;
|
||||
case ItemValuableDepotType.CommercialItem:
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -312,24 +312,6 @@ namespace Campofinale
|
||||
teams.Add(new Team());
|
||||
teams.Add(new Team());
|
||||
bitsetManager.Load(new Dictionary<int, List<int>>());
|
||||
/*mails.Add(new Mail()
|
||||
{
|
||||
expireTime=DateTime.UtcNow.AddDays(30).Ticks,
|
||||
sendTime=DateTime.UtcNow.Ticks,
|
||||
claimed=false,
|
||||
guid=random.Next(),
|
||||
owner=roleId,
|
||||
isRead=false,
|
||||
content=new Mail_Content()
|
||||
{
|
||||
content= "Welcome to Campofinale, Join our Discord for help: https://discord.gg/5uJGJJEFHa",
|
||||
senderName="SuikoAkari",
|
||||
title="Welcome",
|
||||
templateId="",
|
||||
}
|
||||
|
||||
});*/
|
||||
|
||||
|
||||
spaceshipManager.Load();
|
||||
}
|
||||
@@ -348,8 +330,6 @@ namespace Campofinale
|
||||
}
|
||||
else
|
||||
{
|
||||
//sceneManager.UnloadCurrent(false);
|
||||
//sceneManager.LoadCurrent();
|
||||
sceneLoadState = SceneLoadState.Loading;
|
||||
Send(new PacketScEnterSceneNotify(this, curSceneNumId));
|
||||
}
|
||||
@@ -370,7 +350,6 @@ namespace Campofinale
|
||||
|
||||
}
|
||||
public SceneLoadState sceneLoadState=0;
|
||||
// public bool LoadFinish = true;
|
||||
public void EnterScene(int sceneNumId, Vector3f pos, Vector3f rot, PassThroughData passThroughData = null)
|
||||
{
|
||||
// if (!LoadFinish) return;
|
||||
@@ -573,15 +552,10 @@ namespace Campofinale
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Disconnect();
|
||||
}
|
||||
public void Kick(CODE code, string optionalMsg="")
|
||||
{
|
||||
|
||||
Send(ScMsgId.ScNtfErrorCode, new ScNtfErrorCode()
|
||||
{
|
||||
Details = optionalMsg,
|
||||
@@ -606,8 +580,6 @@ namespace Campofinale
|
||||
Logger.Print($"{nickname} Disconnected");
|
||||
socket.Disconnect(false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public void Save()
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Campofinale
|
||||
public static Dispatch? dispatch;
|
||||
public static ConfigFile? config;
|
||||
public static List<CsMsgId> csMessageToHide = new() { CsMsgId.CsMoveObjectMove, CsMsgId.CsBattleOp,CsMsgId.CsPing };
|
||||
public static List<ScMsgId> scMessageToHide = new() { ScMsgId.ScMoveObjectMove, ScMsgId.ScPing,ScMsgId.ScObjectEnterView };
|
||||
public static List<ScMsgId> scMessageToHide = new() { ScMsgId.ScMoveObjectMove, ScMsgId.ScPing,ScMsgId.ScObjectEnterView,ScMsgId.ScFactoryHsSync };
|
||||
public void Start(ConfigFile config)
|
||||
{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user