protected override bool TryCastShot()
        {
            bool flag = false;

            this.TargetsAoE.Clear();
            this.UpdateTargets();
            int  shotsPerBurst = this.ShotsPerBurst;
            bool flag2         = this.UseAbilityProps.AbilityTargetCategory != AbilityTargetCategory.TargetAoE && this.TargetsAoE.Count > 1;

            if (flag2)
            {
                this.TargetsAoE.RemoveRange(0, this.TargetsAoE.Count - 1);
            }
            bool flag3 = this.UseAbilityProps.mustHaveTarget && this.TargetsAoE.Count == 0;
            bool result;

            if (flag3)
            {
                Messages.Message("AU_NoTargets".Translate(), MessageTypeDefOf.RejectInput, true);
                this.Ability.Notify_AbilityFailed(true);
                result = false;
            }
            else
            {
                for (int i = 0; i < this.TargetsAoE.Count; i++)
                {
                    bool abilitySucceeded = true;
                    if (TargetsAoE[i].Thing != null && TargetsAoE[i].Thing is Pawn targetPawn && targetPawn.RaceProps.Humanlike)
                    {
                        abilitySucceeded = SemblanceUtility.UnlockAura(targetPawn, "LetterTextUnlockAuraPyrrha");
                    }
Exemple #2
0
 public override void CompTick()
 {
     base.CompTick();
     if (Pawn.health.hediffSet.HasHediff(RWBYDefOf.RWBY_AuraStolen))
     {
         return;
     }
     if (hiddenSemblance == null)
     {
         GenerateHiddenSemblance();
     }
     if (IsInitialized)
     {
         aura.Tick();
     }
     else
     {
         if (auraAutoUnlock >= 0)
         {
             auraAutoUnlock--;
         }
         if (auraAutoUnlock == 0)
         {
             SemblanceUtility.UnlockAura(AbilityUser, "LetterTextUnlockAuraAuto");
         }
     }
 }
Exemple #3
0
        protected override bool TryExecuteWorker(IncidentParms parms)
        {
            Map         map          = (Map)parms.target;
            List <Pawn> injuredPawns = map.PlayerPawnsForStoryteller.ToList().FindAll(p => p.RaceProps.Humanlike && p.health.hediffSet.hediffs.Any(a => a.GetType().Equals(typeof(Hediff_Injury)) && ((Hediff_Injury)a).TendableNow(true)));

            injuredPawns.RemoveAll(p => p.health.hediffSet.HasHediff(RWBYDefOf.RWBY_AuraStolen));
            List <Pawn> pawnsWithoutAura = injuredPawns.FindAll(p => !p.story.traits.HasTrait(RWBYDefOf.RWBY_Aura) && !SemblanceUtility.semblanceList.Any(s => p.story.traits.HasTrait(s)));

            if (pawnsWithoutAura.Count == 0)
            {
                return(false);
            }
            Pawn pawnWithoutAura = pawnsWithoutAura.RandomElement();

            return(SemblanceUtility.UnlockAura(pawnWithoutAura, "LetterTextUnlockAuraHurt"));
        }