예제 #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
파일: Mine.cs 프로젝트: rbarraud/blarg4
        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
파일: Factory.cs 프로젝트: rbarraud/blarg4
 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
파일: Truck.cs 프로젝트: rbarraud/blarg4
 public Truck(Entity entity, ComponentPrototype proto) : base(entity)
 {
     deployPrototype = proto.data["deploy"];
 }