コード例 #1
0
        protected override GrammarRequest GenerateGrammarRequest()
        {
            GrammarRequest result = base.GenerateGrammarRequest();

            if (this.recipientPawn != null || this.recipientThing != null)
            {
                result.Includes.Add((!this.deflected) ? RulePackDefOf.Combat_RangedDamage : RulePackDefOf.Combat_RangedDeflect);
            }
            else
            {
                result.Includes.Add(RulePackDefOf.Combat_RangedMiss);
            }
            if (this.initiatorPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("INITIATOR", this.initiatorPawn, result.Constants));
            }
            else if (this.initiatorThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("INITIATOR", this.initiatorThing));
            }
            else
            {
                result.Constants["INITIATOR_missing"] = "True";
            }
            if (this.recipientPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("RECIPIENT", this.recipientPawn, result.Constants));
            }
            else if (this.recipientThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("RECIPIENT", this.recipientThing));
            }
            else
            {
                result.Constants["RECIPIENT_missing"] = "True";
            }
            if (this.originalTargetPawn != this.recipientPawn || this.originalTargetThing != this.recipientThing)
            {
                if (this.originalTargetPawn != null)
                {
                    result.Rules.AddRange(GrammarUtility.RulesForPawn("ORIGINALTARGET", this.originalTargetPawn, result.Constants));
                    result.Constants["ORIGINALTARGET_mobile"] = this.originalTargetMobile.ToString();
                }
                else if (this.originalTargetThing != null)
                {
                    result.Rules.AddRange(GrammarUtility.RulesForDef("ORIGINALTARGET", this.originalTargetThing));
                }
                else
                {
                    result.Constants["ORIGINALTARGET_missing"] = "True";
                }
            }
            result.Rules.AddRange(PlayLogEntryUtility.RulesForOptionalWeapon("WEAPON", this.weaponDef, this.projectileDef));
            result.Constants["COVER_missing"] = ((this.coverDef == null) ? "True" : "False");
            if (this.coverDef != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("COVER", this.coverDef));
            }
            return(result);
        }
コード例 #2
0
        protected override GrammarRequest GenerateGrammarRequest()
        {
            GrammarRequest result = base.GenerateGrammarRequest();

            result.Rules.AddRange(PlayLogEntryUtility.RulesForDamagedParts("recipient_part", DamagedBody(), damagedParts, damagedPartsDestroyed, result.Constants));
            result.Constants.Add("deflected", deflected.ToString());
            return(result);
        }
コード例 #3
0
        protected override GrammarRequest GenerateGrammarRequest()
        {
            GrammarRequest result = base.GenerateGrammarRequest();

            if (initiatorPawn == null && initiatorThing == null)
            {
                Log.ErrorOnce("BattleLogEntry_RangedFire has a null initiator.", 60465709);
            }
            if (weaponDef != null && weaponDef.Verbs[0].rangedFireRulepack != null)
            {
                result.Includes.Add(weaponDef.Verbs[0].rangedFireRulepack);
            }
            else
            {
                result.Includes.Add(RulePackDefOf.Combat_RangedFire);
            }
            if (initiatorPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("INITIATOR", initiatorPawn, result.Constants));
            }
            else if (initiatorThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("INITIATOR", initiatorThing));
            }
            else
            {
                result.Constants["INITIATOR_missing"] = "True";
            }
            if (recipientPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("RECIPIENT", recipientPawn, result.Constants));
            }
            else if (recipientThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("RECIPIENT", recipientThing));
            }
            else
            {
                result.Constants["RECIPIENT_missing"] = "True";
            }
            result.Rules.AddRange(PlayLogEntryUtility.RulesForOptionalWeapon("WEAPON", weaponDef, projectileDef));
            if (initiatorPawn != null && initiatorPawn.skills != null)
            {
                result.Constants["INITIATOR_skill"] = initiatorPawn.skills.GetSkill(SkillDefOf.Shooting).Level.ToStringCached();
            }
            if (recipientPawn != null && recipientPawn.skills != null)
            {
                result.Constants["RECIPIENT_skill"] = recipientPawn.skills.GetSkill(SkillDefOf.Shooting).Level.ToStringCached();
            }
            result.Constants["BURST"] = burst.ToString();
            return(result);
        }
コード例 #4
0
        public override string ToGameStringFromPOV(Thing pov)
        {
            Rand.PushState();
            Rand.Seed = base.randSeed;
            GrammarRequest request = default(GrammarRequest);

            request.Includes.Add(RulePackDefOf.Combat_ExplosionImpact);
            if (this.initiatorPawn != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForPawn("initiator", this.initiatorPawn, request.Constants));
            }
            else if (this.initiatorThing != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForDef("initiator", this.initiatorThing));
            }
            else
            {
                request.Constants["initiator_missing"] = "True";
            }
            if (this.recipientPawn != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForPawn("recipient", this.recipientPawn, request.Constants));
            }
            else if (this.recipientThing != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForDef("recipient", this.recipientThing));
            }
            else
            {
                request.Constants["recipient_missing"] = "True";
            }
            request.Rules.AddRange(PlayLogEntryUtility.RulesForOptionalWeapon("weapon", this.weaponDef, this.projectileDef));
            if (this.projectileDef != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForDef("projectile", this.projectileDef));
            }
            if (this.damageDef != null && this.damageDef.combatLogRules != null)
            {
                request.Includes.Add(this.damageDef.combatLogRules);
            }
            request.Rules.AddRange(PlayLogEntryUtility.RulesForDamagedParts("recipient_part", this.damagedParts, this.damagedPartsDestroyed, request.Constants));
            string result = GrammarResolver.Resolve("logentry", request, "ranged explosion", false);

            Rand.PopState();
            return(result);
        }
コード例 #5
0
        protected override GrammarRequest GenerateGrammarRequest()
        {
            GrammarRequest result = base.GenerateGrammarRequest();

            if (this.initiatorPawn == null && this.initiatorThing == null)
            {
                Log.ErrorOnce("BattleLogEntry_RangedFire has a null initiator.", 60465709, false);
            }
            if (this.weaponDef != null && this.weaponDef.Verbs[0].rangedFireRulepack != null)
            {
                result.Includes.Add(this.weaponDef.Verbs[0].rangedFireRulepack);
            }
            else
            {
                result.Includes.Add(RulePackDefOf.Combat_RangedFire);
            }
            if (this.initiatorPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("INITIATOR", this.initiatorPawn, result.Constants));
            }
            else if (this.initiatorThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("INITIATOR", this.initiatorThing));
            }
            else
            {
                result.Constants["INITIATOR_missing"] = "True";
            }
            if (this.recipientPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("RECIPIENT", this.recipientPawn, result.Constants));
            }
            else if (this.recipientThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("RECIPIENT", this.recipientThing));
            }
            else
            {
                result.Constants["RECIPIENT_missing"] = "True";
            }
            result.Rules.AddRange(PlayLogEntryUtility.RulesForOptionalWeapon("WEAPON", this.weaponDef, this.projectileDef));
            result.Constants["BURST"] = this.burst.ToString();
            return(result);
        }
コード例 #6
0
        public override string ToGameStringFromPOV(Thing pov)
        {
            if (this.initiatorPawn == null && this.initiatorThing == null)
            {
                Log.ErrorOnce("BattleLogEntry_RangedFire has a null initiator.", 60465709);
                return("[BattleLogEntry_RangedFire error: null pawn reference]");
            }
            Rand.PushState();
            Rand.Seed = base.randSeed;
            GrammarRequest request = default(GrammarRequest);

            request.Includes.Add(RulePackDefOf.Combat_RangedFire);
            if (this.initiatorPawn != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForPawn("initiator", this.initiatorPawn, request.Constants));
            }
            else if (this.initiatorThing != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForDef("initiator", this.initiatorThing));
            }
            else
            {
                request.Constants["initiator_missing"] = "True";
            }
            if (this.recipientPawn != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForPawn("recipient", this.recipientPawn, request.Constants));
            }
            else if (this.recipientThing != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForDef("recipient", this.recipientThing));
            }
            else
            {
                request.Constants["recipient_missing"] = "True";
            }
            request.Rules.AddRange(PlayLogEntryUtility.RulesForOptionalWeapon("weapon", this.weaponDef, this.projectileDef));
            request.Constants["burst"] = this.burst.ToString();
            string result = GrammarResolver.Resolve("logentry", request, "ranged fire", false);

            Rand.PopState();
            return(result);
        }
コード例 #7
0
        public override string ToGameStringFromPOV(Thing pov)
        {
            if (this.recipientPawn == null)
            {
                Log.ErrorOnce("BattleLogEntry_DamageTaken has a null recipient.", 60465709);
                return("[BattleLogEntry_DamageTaken error: null pawn reference]");
            }
            Rand.PushState();
            Rand.Seed = base.randSeed;
            GrammarRequest request = default(GrammarRequest);

            request.Includes.Add(this.ruleDef);
            request.Rules.AddRange(GrammarUtility.RulesForPawn("recipient", this.recipientPawn, request.Constants));
            request.Rules.AddRange(PlayLogEntryUtility.RulesForDamagedParts("recipient_part", this.damagedParts, this.damagedPartsDestroyed, request.Constants));
            string result = GrammarResolver.Resolve("logentry", request, "damage taken", false);

            Rand.PopState();
            return(result);
        }
コード例 #8
0
        public override string ToGameStringFromPOV(Thing pov)
        {
            Rand.PushState();
            Rand.Seed = base.randSeed;
            GrammarRequest request = default(GrammarRequest);

            request.Rules.AddRange(GrammarUtility.RulesForPawn("initiator", this.initiator, request.Constants));
            if (this.recipientPawn != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForPawn("recipient", this.recipientPawn, request.Constants));
            }
            else if (this.recipientThing != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForDef("recipient", this.recipientThing));
            }
            request.Includes.Add(this.outcomeRuleDef);
            request.Includes.Add(this.maneuverRuleDef);
            if (!this.toolLabel.NullOrEmpty())
            {
                request.Rules.Add(new Rule_String("tool_label", this.toolLabel));
            }
            if (this.implementType != null && !this.implementType.implementOwnerRuleName.NullOrEmpty())
            {
                if (this.ownerEquipmentDef != null)
                {
                    request.Rules.AddRange(GrammarUtility.RulesForDef(this.implementType.implementOwnerRuleName, this.ownerEquipmentDef));
                }
                else if (this.ownerHediffDef != null)
                {
                    request.Rules.AddRange(GrammarUtility.RulesForDef(this.implementType.implementOwnerRuleName, this.ownerHediffDef));
                }
            }
            if (this.implementType != null && !this.implementType.implementOwnerTypeValue.NullOrEmpty())
            {
                request.Constants["implementOwnerType"] = this.implementType.implementOwnerTypeValue;
            }
            request.Rules.AddRange(PlayLogEntryUtility.RulesForDamagedParts("recipient_part", this.damagedParts, this.damagedPartsDestroyed, request.Constants));
            string result = GrammarResolver.Resolve("logentry", request, "combat interaction", false);

            Rand.PopState();
            return(result);
        }
        protected override GrammarRequest GenerateGrammarRequest()
        {
            GrammarRequest result = base.GenerateGrammarRequest();

            result.Includes.Add(RulePackDefOf.Combat_ExplosionImpact);
            if (this.initiatorPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("INITIATOR", this.initiatorPawn, result.Constants));
            }
            else if (this.initiatorThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("INITIATOR", this.initiatorThing));
            }
            else
            {
                result.Constants["INITIATOR_missing"] = "True";
            }
            if (this.recipientPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("RECIPIENT", this.recipientPawn, result.Constants));
            }
            else if (this.recipientThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("RECIPIENT", this.recipientThing));
            }
            else
            {
                result.Constants["RECIPIENT_missing"] = "True";
            }
            result.Rules.AddRange(PlayLogEntryUtility.RulesForOptionalWeapon("WEAPON", this.weaponDef, this.projectileDef));
            if (this.projectileDef != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("PROJECTILE", this.projectileDef));
            }
            if (this.damageDef != null && this.damageDef.combatLogRules != null)
            {
                result.Includes.Add(this.damageDef.combatLogRules);
            }
            return(result);
        }
コード例 #10
0
        protected override GrammarRequest GenerateGrammarRequest()
        {
            GrammarRequest result = base.GenerateGrammarRequest();

            if (recipientPawn != null || recipientThing != null)
            {
                result.Includes.Add(deflected ? RulePackDefOf.Combat_RangedDeflect : RulePackDefOf.Combat_RangedDamage);
            }
            else
            {
                result.Includes.Add(RulePackDefOf.Combat_RangedMiss);
            }
            if (initiatorPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("INITIATOR", initiatorPawn, result.Constants));
            }
            else if (initiatorThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("INITIATOR", initiatorThing));
            }
            else
            {
                result.Constants["INITIATOR_missing"] = "True";
            }
            if (recipientPawn != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForPawn("RECIPIENT", recipientPawn, result.Constants));
            }
            else if (recipientThing != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("RECIPIENT", recipientThing));
            }
            else
            {
                result.Constants["RECIPIENT_missing"] = "True";
            }
            if (originalTargetPawn != recipientPawn || originalTargetThing != recipientThing)
            {
                if (originalTargetPawn != null)
                {
                    result.Rules.AddRange(GrammarUtility.RulesForPawn("ORIGINALTARGET", originalTargetPawn, result.Constants));
                    result.Constants["ORIGINALTARGET_mobile"] = originalTargetMobile.ToString();
                }
                else if (originalTargetThing != null)
                {
                    result.Rules.AddRange(GrammarUtility.RulesForDef("ORIGINALTARGET", originalTargetThing));
                }
                else
                {
                    result.Constants["ORIGINALTARGET_missing"] = "True";
                }
            }
            result.Rules.AddRange(PlayLogEntryUtility.RulesForOptionalWeapon("WEAPON", weaponDef, projectileDef));
            if (initiatorPawn != null && initiatorPawn.skills != null)
            {
                result.Constants["INITIATOR_skill"] = initiatorPawn.skills.GetSkill(SkillDefOf.Shooting).Level.ToStringCached();
            }
            if (recipientPawn != null && recipientPawn.skills != null)
            {
                result.Constants["RECIPIENT_skill"] = recipientPawn.skills.GetSkill(SkillDefOf.Shooting).Level.ToStringCached();
            }
            result.Constants["COVER_missing"] = ((coverDef != null) ? "False" : "True");
            if (coverDef != null)
            {
                result.Rules.AddRange(GrammarUtility.RulesForDef("COVER", coverDef));
            }
            return(result);
        }
コード例 #11
0
        public override string ToGameStringFromPOV(Thing pov)
        {
            Rand.PushState();
            Rand.Seed = this.randSeed;
            GrammarRequest request = default(GrammarRequest);

            if (this.recipientPawn != null || this.recipientThing != null)
            {
                request.Includes.Add(RulePackDefOf.Combat_RangedDamage);
            }
            else
            {
                request.Includes.Add(RulePackDefOf.Combat_RangedMiss);
            }
            if (this.initiatorPawn != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForPawn("initiator", this.initiatorPawn, request.Constants));
            }
            else if (this.initiatorThing != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForDef("initiator", this.initiatorThing));
            }
            else
            {
                request.Constants["initiator_missing"] = "True";
            }
            if (this.recipientPawn != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForPawn("recipient", this.recipientPawn, request.Constants));
            }
            else if (this.recipientThing != null)
            {
                request.Rules.AddRange(GrammarUtility.RulesForDef("recipient", this.recipientThing));
            }
            else
            {
                request.Constants["recipient_missing"] = "True";
            }
            if (this.originalTargetPawn != this.recipientPawn || this.originalTargetThing != this.recipientThing)
            {
                if (this.originalTargetPawn != null)
                {
                    request.Rules.AddRange(GrammarUtility.RulesForPawn("originalTarget", this.originalTargetPawn, request.Constants));
                    request.Constants["originalTarget_mobile"] = this.originalTargetMobile.ToString();
                }
                else if (this.originalTargetThing != null)
                {
                    request.Rules.AddRange(GrammarUtility.RulesForDef("originalTarget", this.originalTargetThing));
                }
                else
                {
                    request.Constants["originalTarget_missing"] = "True";
                }
            }
            request.Rules.AddRange(PlayLogEntryUtility.RulesForOptionalWeapon("weapon", this.weaponDef, this.projectileDef));
            request.Rules.AddRange(PlayLogEntryUtility.RulesForDamagedParts("recipient_part", this.damagedParts, this.damagedPartsDestroyed, request.Constants));
            string result = GrammarResolver.Resolve("logentry", request, "ranged damage", false);

            Rand.PopState();
            return(result);
        }