public Projectile(Entity entity, ComponentPrototype proto) : base(entity) { speed = DReal.Parse(proto.data["speed"]); directDamage = DReal.Parse(proto.data["directDamage"]); splashDamage = DReal.Parse(proto.data["splashDamage"]); splashRadius = DReal.Parse(proto.data["splashRadius"]); }
public WizardTower(Entity entity, ComponentPrototype proto) : base(entity) { harvesterPrototype = proto.data["harvester"]; harvesterBuildCooldown = DReal.Parse(World.current.entityPrototypes[harvesterPrototype].data["buildTime"]); wizardPrototype = proto.data["wizard"]; wizardBuildCooldown = DReal.Parse(World.current.entityPrototypes[harvesterPrototype].data["buildTime"]); }
public Collider(Entity entity, ComponentPrototype proto) : base(entity) { height = DReal.Parse(proto.data["height"]); radius = DReal.Parse(proto.data["radius"]); fixedPosition = proto.data["fixedPosition"] == "true"; pushy = proto.data["pushy"] == "true"; }
public Wizard(Entity entity, ComponentPrototype proto) : base(entity) { towerPrototype = proto.data["tower"]; towerBuildCooldown = DReal.Parse(World.current.entityPrototypes[towerPrototype].data["buildTime"]); towerBuildCooldownRemaining = towerBuildCooldown; tower = null; }
public ResourceHarvester(Entity entity, ComponentPrototype proto) : base(entity) { this.motor = entity.GetComponent <IMotor>(); resourceId = World.current.resourceNameToId[proto.data["resource"]]; capacity = DReal.Parse(proto.data["capacity"]); fillRate = DReal.Parse(proto.data["rate"]); this.fill = 0; }
public ResourceCollectionPoint(Entity entity, ComponentPrototype proto) : base(entity) { this.resourceId = World.current.resourceNameToId[proto.data["resource"]]; var team_ent = World.current.entities.First(e => e.team == entity.team && e.GetComponents <ResourcePool>().Any(p => p.resourceId == resourceId)); pool = team_ent.GetComponents <ResourcePool>().First(p => p.resourceId == resourceId); }
public MineTruck(Entity entity, ComponentPrototype proto) : base(entity) { motor = entity.GetComponent <IMotor>(); mineTypes = proto.data .Select(kv => new KeyValuePair <int, String>(World.current.resourceNameToId.ContainsKey(kv.Key) ? World.current.resourceNameToId[kv.Key] : -1, kv.Value)) .Where(kv => kv.Key != -1) .OrderBy(kv => kv.Key) .ToArray(); }
public Mine(Entity entity, ComponentPrototype proto) : base(entity) { this.rate = DReal.Parse(proto.data["rate"]); var resource = World.current.resourceNameToId[proto.data["resource"]]; var team_ent = World.current.entities.First(e => e.team == entity.team && e.GetComponents <ResourcePool>().Any(p => p.resourceId == resource)); pool = team_ent.GetComponents <ResourcePool>().First(p => p.resourceId == resource); }
public AirMotor(Entity entity, ComponentPrototype proto) : base(entity) { moveSpeed = DReal.Parse(proto.data["speed"]); wobbleFrequency = DReal.Parse(proto.data["wobbleFrequency"]); wobbleAmplitude = DReal.Parse(proto.data["wobbleAmplitude"]); floatOffset = DReal.Parse(proto.data["floatOffset"]); verticalSpeed = DReal.Parse(proto.data["verticalSpeed"]); wobbleOffset = World.current.RandomValue() * DReal.PI; }
public HitscanWeapon(Entity entity, ComponentPrototype proto) : base(entity) { range = DReal.Parse(proto.data["range"]); damage = DReal.Parse(proto.data["damage"]); fireRate = DReal.Parse(proto.data["fireRate"]); sustainTime = DReal.Parse(proto.data["sustainTime"]); effect = proto.data["effect"]; refireTime = 0; sustainRemaining = 0; sustainTarget = null; }
public ProjectileWeapon(Entity entity, ComponentPrototype proto) : base(entity) { projectile = proto.data["projectile"]; range = DReal.Parse(proto.data["range"]); fireRate = DReal.Parse(proto.data["fireRate"]); randomOffset = new DVector3(DReal.Parse(proto.data["randomOffsetX"]), DReal.Parse(proto.data["randomOffsetY"]), DReal.Parse(proto.data["randomOffsetZ"])); fireTime = 0; }
public Factory(Entity entity, ComponentPrototype proto) : base(entity) { // Eugh. buildables = new string[10]; proto.data.TryGetValue("build0", out buildables[0]); proto.data.TryGetValue("build1", out buildables[1]); proto.data.TryGetValue("build2", out buildables[2]); proto.data.TryGetValue("build3", out buildables[3]); proto.data.TryGetValue("build4", out buildables[4]); proto.data.TryGetValue("build5", out buildables[5]); proto.data.TryGetValue("build6", out buildables[6]); proto.data.TryGetValue("build7", out buildables[7]); proto.data.TryGetValue("build8", out buildables[8]); proto.data.TryGetValue("build9", out buildables[9]); }
public ResourcePool(Entity entity, ComponentPrototype proto) : base(entity) { this.resourceId = World.current.resourceNameToId[proto.data["resource"]]; this.fill = DReal.Parse(proto.data["initial"]); }
public Team(Entity entity, ComponentPrototype proto) : base(entity) { }
public BuildRadius(Entity entity, ComponentPrototype proto) : base(entity) { radius = DReal.Parse(proto.data["radius"]); }
public ResourceSource(Entity entity, ComponentPrototype proto) : base(entity) { this.resourceId = World.current.resourceNameToId[proto.data["resource"]]; this.remainingCount = DReal.Parse(proto.data["initial"]); this.occupied = false; }
public GroundMotor(Entity entity, ComponentPrototype proto) : base(entity) { moveSpeed = DReal.Parse(proto.data["speed"]); }
public BasicUnit(Entity entity, ComponentPrototype proto) : base(entity) { }
public Health(Entity entity, ComponentPrototype proto) : base(entity) { max = DReal.Parse(proto.data["max"]); current = max; }
public Truck(Entity entity, ComponentPrototype proto) : base(entity) { deployPrototype = proto.data["deploy"]; }