Exemplo n.º 1
0
        protected override void Impact(Thing hitThing)
        {
            Map map = base.Map;

            base.Impact(hitThing);
            ThingDef def = this.def;

            this.caster = this.launcher as Pawn;

            if (!this.initialized)
            {
                CompAbilityUserMagic comp = caster.GetComp <CompAbilityUserMagic>();
                MagicPowerSkill      pwr  = caster.GetComp <CompAbilityUserMagic>().MagicData.MagicPowerSkill_HealingCircle.FirstOrDefault((MagicPowerSkill x) => x.label == "TM_HealingCircle_pwr");
                MagicPowerSkill      ver  = caster.GetComp <CompAbilityUserMagic>().MagicData.MagicPowerSkill_HealingCircle.FirstOrDefault((MagicPowerSkill x) => x.label == "TM_HealingCircle_ver");
                pwrVal = pwr.level;
                verVal = ver.level;
                if (caster.story.traits.HasTrait(TorannMagicDefOf.Faceless))
                {
                    MightPowerSkill mpwr = caster.GetComp <CompAbilityUserMight>().MightData.MightPowerSkill_Mimic.FirstOrDefault((MightPowerSkill x) => x.label == "TM_Mimic_pwr");
                    MightPowerSkill mver = caster.GetComp <CompAbilityUserMight>().MightData.MightPowerSkill_Mimic.FirstOrDefault((MightPowerSkill x) => x.label == "TM_Mimic_ver");
                    pwrVal = mpwr.level;
                    verVal = mver.level;
                }
                this.arcaneDmg = comp.arcaneDmg;
                ModOptions.SettingsRef settingsRef = new ModOptions.SettingsRef();
                if (!caster.IsColonist && settingsRef.AIHardMode)
                {
                    pwrVal = 3;
                    verVal = 3;
                }
                this.radius   = this.def.projectile.explosionRadius;
                this.angle    = Rand.Range(-12, 12);
                this.duration = this.duration + (180 * (pwrVal + verVal));
                //TM_MoteMaker.MakePowerBeamMote(base.Position, base.Map, this.radius * 8f, 1.2f, this.duration/60f);
                this.initialized = true;
            }

            if (this.age >= this.lastWave)
            {
                if (this.age >= this.lastHeal + this.healDelay)
                {
                    switch (ringFrac)
                    {
                    case 0:
                        this.innerRing = 0;
                        this.outerRing = this.radius * ((ringFrac + .1f) / 5f);
                        TM_MoteMaker.MakePowerBeamMote(base.Position, base.Map, this.radius * 6f, 1.2f, this.waveDelay / 60f, (this.healDelay * 3f) / 60f, (this.healDelay * 2f) / 60f);
                        break;

                    case 1:
                        this.innerRing = this.outerRing;
                        this.outerRing = this.radius * ((ringFrac) / 5f);
                        break;

                    case 2:
                        this.innerRing = this.outerRing;
                        this.outerRing = this.radius * ((ringFrac) / 5f);
                        break;

                    case 3:
                        this.innerRing = this.outerRing;
                        this.outerRing = this.radius * ((ringFrac) / 5f);
                        break;

                    case 4:
                        this.innerRing = this.outerRing;
                        this.outerRing = this.radius * ((ringFrac) / 5f);
                        break;

                    case 5:
                        this.innerRing = this.outerRing;
                        this.outerRing = this.radius;
                        this.lastWave  = this.age + this.waveDelay;
                        break;
                    }
                    ringFrac++;
                    this.lastHeal = this.age;
                    Search(map);
                }
                if (ringFrac >= 6)
                {
                    ringFrac = 0;
                }
            }
        }