mirror of
https://git.muiegratis.online/suikoakari/Campofinale
synced 2025-12-13 01:54:38 +01:00
some factory components (not finished)
This commit is contained in:
23
Campofinale/Game/Factory/Components/FComponentBattle.cs
Normal file
23
Campofinale/Game/Factory/Components/FComponentBattle.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Campofinale.Resource;
|
||||
using static Campofinale.Game.Factory.FactoryNode;
|
||||
|
||||
namespace Campofinale.Game.Factory.Components
|
||||
{
|
||||
public class FComponentBattle : FComponent
|
||||
{
|
||||
public int EnergyCurrent=100;
|
||||
public FComponentBattle(uint id) : base(id, FCComponentType.Battle)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetComponentInfo(ScdFacCom proto)
|
||||
{
|
||||
proto.Battle = new()
|
||||
{
|
||||
EnergyCurrent=100,
|
||||
EnergyMax=100,
|
||||
InOverloading=false
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Campofinale/Game/Factory/Components/FComponentCache.cs
Normal file
21
Campofinale/Game/Factory/Components/FComponentCache.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Campofinale.Resource;
|
||||
using static Campofinale.Game.Factory.FactoryNode;
|
||||
|
||||
namespace Campofinale.Game.Factory.Components
|
||||
{
|
||||
public class FComponentCache : FComponent
|
||||
{
|
||||
|
||||
public FComponentCache(uint id) : base(id, FCComponentType.Cache)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetComponentInfo(ScdFacCom proto)
|
||||
{
|
||||
proto.Cache = new()
|
||||
{
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Campofinale/Game/Factory/Components/FComponentFormulaMan.cs
Normal file
20
Campofinale/Game/Factory/Components/FComponentFormulaMan.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Campofinale.Resource;
|
||||
using static Campofinale.Game.Factory.FactoryNode;
|
||||
|
||||
namespace Campofinale.Game.Factory.Components
|
||||
{
|
||||
public class FComponentFormulaMan : FComponent
|
||||
{
|
||||
public FComponentFormulaMan(uint id) : base(id, FCComponentType.FormulaMan)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetComponentInfo(ScdFacCom proto)
|
||||
{
|
||||
proto.FormulaMan = new()
|
||||
{
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,18 @@ namespace Campofinale.Game.Factory.Components
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public FComponentPortManager(uint id, int size) : base(id, FCComponentType.PortManager)
|
||||
{
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
ports.Add(new FPort()
|
||||
{
|
||||
index = i,
|
||||
ownerComId = 0,
|
||||
touchComId = 0
|
||||
});
|
||||
}
|
||||
}
|
||||
public override void SetComponentInfo(ScdFacCom proto)
|
||||
{
|
||||
proto.PortManager = new();
|
||||
|
||||
20
Campofinale/Game/Factory/Components/FComponentProducer.cs
Normal file
20
Campofinale/Game/Factory/Components/FComponentProducer.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Campofinale.Resource;
|
||||
using static Campofinale.Game.Factory.FactoryNode;
|
||||
|
||||
namespace Campofinale.Game.Factory.Components
|
||||
{
|
||||
public class FComponentProducer : FComponent
|
||||
{
|
||||
public FComponentProducer(uint id) : base(id, FCComponentType.Producer)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetComponentInfo(ScdFacCom proto)
|
||||
{
|
||||
proto.Producer = new()
|
||||
{
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -721,6 +721,19 @@ namespace Campofinale.Game.Factory
|
||||
case FCNodeType.PowerDiffuser:
|
||||
components.Add(new FComponentPowerPole(chapter.nextCompV()).Init());
|
||||
break;
|
||||
case FCNodeType.Battle:
|
||||
components.Add(new FComponentBattle(chapter.nextCompV()).Init());
|
||||
break;
|
||||
case FCNodeType.Producer:
|
||||
|
||||
components.Add(new FComponentPortManager(chapter.nextCompV(), 3).Init());
|
||||
components.Add(new FComponentPortManager(chapter.nextCompV(), 3).Init());
|
||||
components.Add(new FComponentProducer(chapter.nextCompV()).Init());
|
||||
components.Add(new FComponentFormulaMan(chapter.nextCompV()).Init());
|
||||
components.Add(new FComponentCache(chapter.nextCompV()).Init());
|
||||
components.Add(new FComponentCache(chapter.nextCompV()).Init());
|
||||
components.Add(new FComponentCache(chapter.nextCompV()).Init());
|
||||
break;
|
||||
case FCNodeType.TravelPole:
|
||||
components.Add(new FComponentTravelPole(chapter.nextCompV()).Init());
|
||||
break;
|
||||
@@ -783,12 +796,16 @@ namespace Campofinale.Game.Factory
|
||||
}
|
||||
else
|
||||
{
|
||||
EntityInteractive e = new(interactiveFacWrapperTable[templateId].interactiveTemplateId, player.roleId, worldPosition, direction, sceneNumId, guid);
|
||||
e.InitDefaultProperties();
|
||||
e.SetPropValue(nodeId, "factory_inst_id");
|
||||
if (interactiveFacWrapperTable.ContainsKey(templateId))
|
||||
{
|
||||
EntityInteractive e = new(interactiveFacWrapperTable[templateId].interactiveTemplateId, player.roleId, worldPosition, direction, sceneNumId, guid);
|
||||
e.InitDefaultProperties();
|
||||
e.SetPropValue(nodeId, "factory_inst_id");
|
||||
|
||||
player.sceneManager.GetCurScene().entities.Add(e);
|
||||
player.sceneManager.GetCurScene().SpawnEntity(e);
|
||||
player.sceneManager.GetCurScene().entities.Add(e);
|
||||
player.sceneManager.GetCurScene().SpawnEntity(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -829,6 +846,14 @@ namespace Campofinale.Game.Factory
|
||||
{
|
||||
case FCComponentType.PowerPole:
|
||||
return FCComponentPos.PowerPole;
|
||||
case FCComponentType.TravelPole:
|
||||
return FCComponentPos.TravelPole;
|
||||
case FCComponentType.Battle:
|
||||
return FCComponentPos.Battle1;
|
||||
case FCComponentType.Producer:
|
||||
return FCComponentPos.Producer;
|
||||
case FCComponentType.FormulaMan:
|
||||
return FCComponentPos.FormulaMan;
|
||||
}
|
||||
return FCComponentPos.Invalid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user