コード例 #1
0
ファイル: PawnAbility.cs プロジェクト: Ogliss/AdMechArmoury
 public PawnAbility(Pawn user, AbilityDef pdef)
 {
     pawn        = user;
     powerdef    = pdef;
     powerButton = pdef.uiIcon;
     //Log.Message("PawnAbility Created: " + this.Def.defName);
 }
コード例 #2
0
        private void AddAbilityInternal(AbilityDef abilityDef, List <PawnAbility> thelist, bool activenow,
                                        float savedTicks)
        {
            var pa = (PawnAbility)Activator.CreateInstance(abilityDef.abilityClass);

            pa.Pawn = AbilityUser;
            pa.Def  = abilityDef;
            thelist.Add(pa);
            UpdateAbilities();
        }
コード例 #3
0
 public void Launch(Thing launcher, AbilityDef abilityDef, Vector3 origin, LocalTargetInfo targ,
                    ProjectileHitFlags hitFlags, Thing equipment = null, List <ApplyHediffs> applyHediffs = null,
                    List <ApplyMentalStates> applyMentalStates   = null, List <SpawnThings> spawnThings   = null)
 {
     //Log.Message("Projectile_AbilityBase");
     localApplyHediffs      = applyHediffs;
     localApplyMentalStates = applyMentalStates;
     localSpawnThings       = spawnThings;
     localAbilityDef        = abilityDef;
     base.Launch(launcher, targ, targ, hitFlags, equipment); //TODO
 }
コード例 #4
0
        private void RemoveAbilityInternal(AbilityDef abilityDef, List <PawnAbility> thelist)
        {
            var abilityToRemove = thelist.FirstOrDefault(x => x.Def == abilityDef);

            if (abilityToRemove != null)
            {
                thelist.Remove(abilityToRemove);
            }
            abilityToRemove = AbilityData.Powers.FirstOrDefault(x => x.Def == abilityDef);
            if (abilityToRemove != null)
            {
                AbilityData.Powers.Remove(abilityToRemove);
            }
            UpdateAbilities();
        }
コード例 #5
0
        // Token: 0x06002189 RID: 8585 RVA: 0x000CB488 File Offset: 0x000C9688
        public override void DrawHighlight(LocalTargetInfo target)
        {
            AbilityDef def = this.ability.def;

            this.DrawRadius();
            if (this.CanHitTarget(target) && this.IsApplicableTo(target, false))
            {
                if (def.HasAreaOfEffect)
                {
                    if (target.IsValid)
                    {
                        GenDraw.DrawTargetHighlight(target);
                        GenDraw.DrawRadiusRing(target.Cell, def.EffectRadius, Verb_CastAbility.RadiusHighlightColor, null);
                    }
                }
                else
                {
                    GenDraw.DrawTargetHighlight(target);
                }
            }
            if (target.IsValid)
            {
                this.ability.DrawEffectPreviews(target);
            }
            this.verbProps.DrawRadiusRing(this.caster.Position);
            if (target.IsValid)
            {
                GenDraw.DrawTargetHighlight(target);
                bool      flag;
                float     num = this.HighlightFieldRadiusAroundTarget(out flag);
                ShootLine shootLine;
                if (num > 0.2f && this.TryFindShootLineFromTo(this.caster.Position, target, out shootLine))
                {
                    if (flag)
                    {
                        GenExplosion.RenderPredictedAreaOfEffect(shootLine.Dest, num);
                        return;
                    }
                    GenDraw.DrawFieldEdges((from x in GenRadial.RadialCellsAround(shootLine.Dest, num, true)
                                            where x.InBounds(Find.CurrentMap)
                                            select x).ToList <IntVec3>());
                }
            }
        }
コード例 #6
0
 public void RemoveApparelAbility(AbilityDef abilityDef)
 {
     RemoveAbilityInternal(abilityDef, AbilityData.TemporaryApparelPowers);
 }
コード例 #7
0
 public void RemoveWeaponAbility(AbilityDef abilityDef)
 {
     RemoveAbilityInternal(abilityDef, AbilityData.TemporaryWeaponPowers);
 }
コード例 #8
0
 public void RemovePawnAbility(AbilityDef abilityDef)
 {
     RemoveAbilityInternal(abilityDef, AbilityData.Powers);
 }
コード例 #9
0
 public void AddApparelAbility(AbilityDef abilityDef, bool activenow = true, float savedTicks = -1)
 {
     AddAbilityInternal(abilityDef, AbilityData.TemporaryApparelPowers, activenow, savedTicks);
 }
コード例 #10
0
        //public List<Verb_UseAbility> AbilityVerbs = new List<Verb_UseAbility>();

        public void AddPawnAbility(AbilityDef abilityDef, bool activenow = true, float savedTicks = -1)
        {
            AddAbilityInternal(abilityDef, AbilityData.Powers, activenow, savedTicks);
        }