/*
     * @Override
     * public Object clone() throws CloneNotSupportedException
     * {
     *
     *  OptionConversationNode ocn = (OptionConversationNode) super.clone( );
     *  ocn.effectConsumed = effectConsumed;
     *  ocn.effects = ( effects != null ? (Effects) effects.clone( ) : null );
     *  /*		if (optionNodes != null) {
     *                          ocn.optionNodes = new List<ConversationNode>();
     *                          for (ConversationNode cn : optionNodes)
     *                                  ocn.optionNodes.add((ConversationNode) cn.clone());
     *                  }*/ /*
     *  ocn.optionNodes = new List<ConversationNode>( );
     *  if( options != null ) {
     *      ocn.options = new List<ConversationLine>( );
     *      for( ConversationLine cl : options )
     *          ocn.options.add( (ConversationLine) cl.clone( ) );
     *  }
     * ocn.random = random;
     *  ocn.keepShowing = keepShowing;
     *  ocn.showUserOption = showUserOption;
     *  return ocn;
     * }*/

    public override object Clone()
    {
        OptionConversationNode ocn = (OptionConversationNode)base.Clone();

        ocn.effectConsumed = effectConsumed;
        ocn.effects        = (effects != null ? (Effects)effects.Clone() : null);

        /*		if (optionNodes != null) {
         *                      ocn.optionNodes = new ArrayList<ConversationNode>();
         *                      for (ConversationNode cn : optionNodes)
         *                              ocn.optionNodes.add((ConversationNode) cn.clone());
         *              }*/
        ocn.optionNodes = new List <ConversationNode>();
        if (options != null)
        {
            ocn.options = new List <ConversationLine>();
            foreach (ConversationLine cl in options)
            {
                ocn.options.Add((ConversationLine)cl.Clone());
            }
        }
        ocn.random         = random;
        ocn.keepShowing    = keepShowing;
        ocn.showUserOption = showUserOption;
        return(ocn);
    }
    /*
     * @Override
     * public Object clone() throws CloneNotSupportedException
     * {
     *
     *  Cutscene c = (Cutscene) super.clone( );
     *  c.next = next;
     *  c.destinyX = destinyX;
     *  c.destinyY = destinyY;
     *  c.effects = ( effects != null ? (Effects) effects.clone( ) : null );
     *  c.idTarget = ( idTarget != null ? new string(idTarget ) : null );
     *  return c;
     * }*/

    public override object Clone()
    {
        Cutscene c = (Cutscene)base.Clone();

        c.next     = next;
        c.destinyX = destinyX;
        c.destinyY = destinyY;
        c.effects  = (effects != null ? (Effects)effects.Clone() : null);
        c.idTarget = (idTarget != null ? idTarget: null);
        return(c);;
    }
Exemple #3
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public PdfImageConfig Clone()
        {
            var styleCloned = (PdfImageConfig)MemberwiseClone();

            if (Effects != null)
            {
                styleCloned.Effects = (EffectType[])Effects.Clone();
            }

            return(styleCloned);
        }
Exemple #4
0
    public object Clone()
    {
        NextScene ns = (NextScene)this.MemberwiseClone();

        ns.conditions  = (conditions != null ? (Conditions)conditions.Clone() : null);
        ns.destinyX    = destinyX;
        ns.destinyY    = destinyY;
        ns.effects     = (effects != null ? (Effects)effects.Clone() : null);
        ns.look        = (look != null ? (ExitLook)look.Clone() : null);
        ns.nextSceneId = (nextSceneId != null ? nextSceneId : null);
        ns.postEffects = (postEffects != null ? (Effects)postEffects.Clone() : null);
        return(ns);
    }
Exemple #5
0
    public object Clone()
    {
        Timer t = (Timer)this.MemberwiseClone();

        t.documentation    = (documentation != null ? documentation : null);
        t.effect           = (effect != null ? (Effects)effect.Clone() : null);
        t.endCond          = (endCond != null ? (Conditions)endCond.Clone() : null);
        t.initCond         = (initCond != null ? (Conditions)initCond.Clone() : null);
        t.postEffect       = (postEffect != null ? (Effects)postEffect.Clone() : null);
        t.seconds          = seconds;
        t.runsInLoop       = runsInLoop;
        t.multipleStarts   = multipleStarts;
        t.usesEndCondition = usesEndCondition;
        return(t);
    }
Exemple #6
0
    public virtual object Clone()
    {
        Action a = (Action)this.MemberwiseClone();

        a.conditions            = (conditions != null ? (Conditions)conditions.Clone() : null);
        a.documentation         = (documentation != null ? documentation : null);
        a.effects               = (effects != null ? (Effects)effects.Clone() : null);
        a.idTarget              = (idTarget != null ? idTarget : null);
        a.keepDistance          = keepDistance;
        a.needsGoTo             = needsGoTo;
        a.type                  = type;
        a.notEffects            = (notEffects != null ? (Effects)notEffects.Clone() : null);
        a.activatedNotEffects   = activatedNotEffects;
        a.activatedClickEffects = activatedClickEffects;
        a.clickEffects          = (clickEffects != null ? (Effects)clickEffects.Clone() : null);
        a.conditionsAreMeet     = conditionsAreMeet;
        return(a);
    }
Exemple #7
0
    /*
     * @Override
     * public Object clone() throws CloneNotSupportedException
     * {
     *
     *  DialogueConversationNode dcn = (DialogueConversationNode) super.clone( );
     *  if( dialogue != null ) {
     *      dcn.dialogue = new List<ConversationLine>();
     *      for (ConversationLine cl : dialogue)
     *          dcn.dialogue.add((ConversationLine)cl.clone());
     *  }
     *  dcn.effectConsumed = effectConsumed;
     *  dcn.effects = ( effects != null ? (Effects) effects.clone( ) : null );
     *  //dcn.nextNode = (nextNode != null ? (ConversationNode) nextNode.clone() : null);
     *  dcn.nextNode = null;
     *  dcn.terminal = terminal;
     *  dcn.keepShowing = keepShowing;
     *  return dcn;
     * }*/

    public override object Clone()
    {
        DialogueConversationNode dcn = (DialogueConversationNode)base.Clone();

        if (dialogue != null)
        {
            dcn.dialogue = new List <ConversationLine>();
            foreach (ConversationLine cl in dialogue)
            {
                dcn.dialogue.Add((ConversationLine)cl.Clone());
            }
        }
        dcn.effectConsumed = effectConsumed;
        dcn.effects        = (effects != null ? (Effects)effects.Clone() : null);
        //dcn.nextNode = (nextNode != null ? (ConversationNode) nextNode.clone() : null);
        dcn.nextNode    = null;
        dcn.terminal    = terminal;
        dcn.keepShowing = keepShowing;
        return(dcn);
    }
Exemple #8
0
        public override Action Clone()
        {
            ParametrizedAction aNew = new ParametrizedAction(Name);

            aNew.Parameters = Parameters;
            if (Preconditions != null)
            {
                aNew.Preconditions = Preconditions.Clone();
            }
            if (Effects != null)
            {
                aNew.SetEffects(Effects.Clone());
            }
            if (Observe != null)
            {
                aNew.Observe = Observe.Clone();
            }
            aNew.HasConditionalEffects          = HasConditionalEffects;
            aNew.ContainsNonDeterministicEffect = ContainsNonDeterministicEffect;
            return(aNew);
        }
Exemple #9
0
    public object Clone()
    {
        Exit e = (Exit)this.MemberwiseClone();

        e.defaultExitLook = (defaultExitLook != null ? (ExitLook)defaultExitLook.Clone() : null);
        e.documentation   = (documentation != null ? documentation : null);
        e.height          = height;
        if (nextScenes != null)
        {
            e.nextScenes = new List <NextScene>();
            foreach (NextScene ns in nextScenes)
            {
                e.nextScenes.Add((NextScene)ns.Clone());
            }
        }
        e.influenceArea = (influenceArea != null ? (InfluenceArea)influenceArea.Clone() : null);
        e.width         = width;
        e.x             = x;
        e.y             = y;
        e.rectangular   = rectangular;
        if (points != null)
        {
            e.points = new List <Vector2>();
            foreach (Vector2 p in points)
            {
                e.points.Add(new Vector2(p.x, p.y));
            }
        }
        e.conditions     = (conditions != null ? (Conditions)conditions.Clone() : null);
        e.effects        = (effects != null ? (Effects)effects.Clone() : null);
        e.postEffects    = (postEffects != null ? (Effects)postEffects.Clone() : null);
        e.notEffects     = (notEffects != null ? (Effects)notEffects.Clone() : null);
        e.destinyX       = destinyX;
        e.destinyY       = destinyY;
        e.hasNotEffects  = hasNotEffects;
        e.nextSceneId    = (nextSceneId != null ? nextSceneId : null);
        e.transitionTime = transitionTime;
        e.transitionType = transitionType;
        return(e);
    }
Exemple #10
0
        private void Die()
        {
            if (m_dead)
            {
                return;
            }

            ItemTemplate ghostItem;

            if (PetTemplate.GhostItemId == null || (ghostItem = ItemManager.Instance.TryGetTemplate(PetTemplate.GhostItemId.Value)) == null)
            {
                LifePoints = 1;
                logger.Error($"Pet {PetTemplate.Id} died but has not ghost item");
                return;
            }

            var item = ItemManager.Instance.CreatePlayerItem(Owner, ghostItem, (int)Stack, Effects.Clone());

            Owner.Inventory.RemoveItem(this);
            Owner.Inventory.AddItem(item);
            m_dead = true;
        }