Temp is depleted logic
This commit is contained in:
@@ -3863,16 +3863,16 @@ public abstract class DATA
|
||||
Description = "Gain 100 Ether over 50 seconds"
|
||||
})
|
||||
.AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "CONTROL" })
|
||||
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
|
||||
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
|
||||
.AddPart(new EntityRequirementModel
|
||||
{
|
||||
Id = DataType.BUILDING_Acropolis,
|
||||
Id = DataType.STARTING_TownHall_Aru,
|
||||
Requirement = RequirementType.Morph
|
||||
})
|
||||
.AddPart(new EntityProductionModel { Alloy = 50, Cooldown = 50, RequiresWorker = false })
|
||||
.AddPart(new EntityHarvestModel
|
||||
{
|
||||
HarvestedPerInterval = 5, RequiresWorker = false, Resource = ResourceType.Ether, Slots = 1,
|
||||
HarvestedPerInterval = 2, RequiresWorker = false, Resource = ResourceType.Ether, Slots = 1,
|
||||
TotalAmount = 100
|
||||
})
|
||||
},
|
||||
@@ -3888,13 +3888,13 @@ public abstract class DATA
|
||||
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
|
||||
.AddPart(new EntityRequirementModel
|
||||
{
|
||||
Id = DataType.BUILDING_Acropolis,
|
||||
Id = DataType.STARTING_TownHall_QRath,
|
||||
Requirement = RequirementType.Morph
|
||||
})
|
||||
.AddPart(new EntityProductionModel { Alloy = 50, Cooldown = 50, RequiresWorker = false })
|
||||
.AddPart(new EntityHarvestModel
|
||||
{
|
||||
HarvestedPerInterval = 5, RequiresWorker = false, Resource = ResourceType.Ether, Slots = 1,
|
||||
HarvestedPerInterval = 2, RequiresWorker = false, Resource = ResourceType.Ether, Slots = 1,
|
||||
TotalAmount = 100
|
||||
})
|
||||
},
|
||||
|
||||
@@ -12,13 +12,12 @@ public class EntityHarvestModel : IEntityPartInterface
|
||||
public int TotalAmount { get; set; }
|
||||
public bool RequiresWorker { get; set; }
|
||||
|
||||
public float StartedAt { get; set; }
|
||||
|
||||
public bool IsDepleted(float interval)
|
||||
public bool IsDepleted(float interval, float startedAt)
|
||||
{
|
||||
var lifeTime = interval - StartedAt;
|
||||
var lifeTime = interval - startedAt;
|
||||
|
||||
var totalHarvested = (lifeTime - 1) * HarvestedPerInterval;
|
||||
var totalHarvested = lifeTime * HarvestedPerInterval;
|
||||
|
||||
return totalHarvested > TotalAmount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user