Ejemplo n.º 1
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);
        }
        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);
        }
Ejemplo n.º 3
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);
        }
        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);
        }
Ejemplo n.º 5
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);
        }