Пример #1
0
 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"]);
 }
Пример #2
0
 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"]);
 }
Пример #3
0
 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";
 }
Пример #4
0
 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;
 }
Пример #5
0
 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;
 }
Пример #6
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);
        }
Пример #7
0
 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();
 }
Пример #8
0
        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);
        }
Пример #9
0
        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;
        }
Пример #10
0
        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;
        }
Пример #11
0
        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;
        }
Пример #12
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]);
 }
Пример #13
0
 public ResourcePool(Entity entity, ComponentPrototype proto) : base(entity)
 {
     this.resourceId = World.current.resourceNameToId[proto.data["resource"]];
     this.fill       = DReal.Parse(proto.data["initial"]);
 }
Пример #14
0
 public Team(Entity entity, ComponentPrototype proto) : base(entity)
 {
 }
Пример #15
0
 public BuildRadius(Entity entity, ComponentPrototype proto) : base(entity)
 {
     radius = DReal.Parse(proto.data["radius"]);
 }
Пример #16
0
 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;
 }
Пример #17
0
 public GroundMotor(Entity entity, ComponentPrototype proto) : base(entity)
 {
     moveSpeed = DReal.Parse(proto.data["speed"]);
 }
Пример #18
0
 public BasicUnit(Entity entity, ComponentPrototype proto) : base(entity)
 {
 }
Пример #19
0
 public Health(Entity entity, ComponentPrototype proto) : base(entity)
 {
     max     = DReal.Parse(proto.data["max"]);
     current = max;
 }
Пример #20
0
 public Truck(Entity entity, ComponentPrototype proto) : base(entity)
 {
     deployPrototype = proto.data["deploy"];
 }