예제 #1
0
        /// <summary>
        /// Reports that the faction member committed a deed.
        /// </summary>
        /// <param name="tag">Tag of the deed in the deed template library.</param>
        /// <param name="target">Target of the deed.</param>
        public virtual void ReportDeedByActor(FactionMember actor, string tag, FactionMember target)
        {
            if (actor == null)
            {
                Debug.LogWarning("Love/Hate: ReportDeed(" + tag + ") actor is null", this);
                return;
            }
            if (target == null)
            {
                Debug.LogWarning("Love/Hate: ReportDeed(" + tag + ") target is null", this);
                return;
            }
            if (deedTemplateLibrary == null)
            {
                Debug.LogWarning("Love/Hate: ReportDeed(" + tag + ") no Deed Template Library is assigned", this);
                return;
            }
            DeedTemplate deedTemplate;

            if (FindDeedTemplate(tag, out deedTemplate))
            {
                var actorPowerLevel = (actor == null) ? 0 : actor.GetPowerLevel();
                var deed            = Deed.GetNew(deedTemplate.tag, actor.factionID, target.factionID, deedTemplate.impact,
                                                  deedTemplate.aggression, actorPowerLevel, deedTemplate.traits, deedTemplate.permittedEvaluators);
                actor.factionManager.CommitDeed(actor, deed, deedTemplate.requiresSight, dimension, deedTemplate.radius);
                Deed.Release(deed);
            }
        }
예제 #2
0
 public static void Release(WitnessQueueItem item)
 {
     if (item == null)
     {
         return;
     }
     Deed.Release(item.deed);
     pool.Release(item);
 }