Пример #1
0
 public LocalInt DeepCopy()
 {
     LocalInt copy = new LocalInt();
     copy.Key = this.Key;
     copy.Value = this.Value;
     return copy;
 }
Пример #2
0
        public LocalInt DeepCopy()
        {
            LocalInt copy = new LocalInt();

            copy.Key   = this.Key;
            copy.Value = this.Value;
            return(copy);
        }
Пример #3
0
        public Creature DeepCopy()
        {
            Creature copy = new Creature();



            copy.unveilStatInfoTraitTag = unveilStatInfoTraitTag;
            copy.unveilStatInfoTraitDC  = unveilStatInfoTraitDC;
            copy.maxTurnTimeCounter     = maxTurnTimeCounter;
            foreach (String et in this.tagsOfEffectsToRemoveOnMove)
            {
                copy.tagsOfEffectsToRemoveOnMove.Add(et);
            }
            copy.showNormalFrame    = showNormalFrame;    //0
            copy.showAttackingFrame = showAttackingFrame; //1

            copy.showWalkingFrame   = showWalkingFrame;   //2
            copy.showIdlingFrame    = showIdlingFrame;    //3
            copy.showBreathingFrame = showBreathingFrame; //4

            copy.walkAnimationDelayCounter   = walkAnimationDelayCounter;
            copy.idleAnimationDelayCounter   = idleAnimationDelayCounter;
            copy.breathAnimationDelayCounter = breathAnimationDelayCounter;

            copy.hurdle             = hurdle;
            copy.currentFrameNumber = currentFrameNumber;

            copy.factionTag = this.factionTag;
            copy.percentRequirementOfTargetInjuryForHealSpells      = this.percentRequirementOfTargetInjuryForHealSpells;
            copy.percentRequirementOfTargetSPLossForRestoreSPSpells = this.percentRequirementOfTargetInjuryForHealSpells;
            copy.targetPcTag              = this.targetPcTag;
            copy.stayDurationInTurns      = this.stayDurationInTurns;
            copy.percentChanceToCastSpell = this.percentChanceToCastSpell;
            copy.roamDistanceX            = this.roamDistanceX;
            copy.roamDistanceY            = this.roamDistanceY;
            copy.straightLineDistanceX    = this.straightLineDistanceX;
            copy.straightLineDistanceY    = this.straightLineDistanceY;
            copy.goDown           = this.goDown;
            copy.goRight          = this.goRight;
            copy.inactiveTimer    = this.inactiveTimer;;
            copy.cr_tokenFilename = this.cr_tokenFilename;
            copy.combatFacingLeft = this.combatFacingLeft;
            copy.combatFacing     = this.combatFacing;
            copy.combatLocX       = this.combatLocX;
            copy.combatLocY       = this.combatLocY;
            copy.moveDistance     = this.moveDistance;
            copy.initiativeBonus  = this.initiativeBonus;
            copy.cr_name          = this.cr_name;
            copy.cr_tag           = this.cr_tag;
            copy.cr_resref        = this.cr_resref;
            copy.cr_desc          = this.cr_desc;
            copy.cr_level         = this.cr_level;
            copy.hp    = this.hp;
            copy.hpMax = this.hpMax;

            //idea is that creatures are generated at start of each batte by copying template, ie they always start with maxSP in full height (= initial sp)
            copy.spMax = this.sp;

            copy.sp                                   = this.sp;
            copy.cr_XP                                = this.cr_XP;
            copy.AC                                   = this.AC;
            copy.cr_status                            = this.cr_status;
            copy.cr_att                               = this.cr_att;
            copy.cr_attRange                          = this.cr_attRange;
            copy.cr_damageNumDice                     = this.cr_damageNumDice;
            copy.cr_damageDie                         = this.cr_damageDie;
            copy.cr_damageAdder                       = this.cr_damageAdder;
            copy.cr_category                          = this.cr_category;
            copy.cr_projSpriteFilename                = this.cr_projSpriteFilename;
            copy.cr_spriteEndingFilename              = this.cr_spriteEndingFilename;
            copy.cr_attackSound                       = this.cr_attackSound;
            copy.cr_numberOfAttacks                   = this.cr_numberOfAttacks;
            copy.cr_ai                                = this.cr_ai;
            copy.fortitude                            = this.fortitude;
            copy.will                                 = this.will;
            copy.reflex                               = this.reflex;
            copy.damageTypeResistanceValueAcid        = this.damageTypeResistanceValueAcid;
            copy.damageTypeResistanceValueNormal      = this.damageTypeResistanceValueNormal;
            copy.damageTypeResistanceValueCold        = this.damageTypeResistanceValueCold;
            copy.damageTypeResistanceValueElectricity = this.damageTypeResistanceValueElectricity;
            copy.damageTypeResistanceValueFire        = this.damageTypeResistanceValueFire;
            copy.damageTypeResistanceValueMagic       = this.damageTypeResistanceValueMagic;
            copy.damageTypeResistanceValuePoison      = this.damageTypeResistanceValuePoison;
            copy.cr_typeOfDamage                      = this.cr_typeOfDamage;
            copy.onScoringHit                         = this.onScoringHit;
            copy.onScoringHitParms                    = this.onScoringHitParms;
            copy.onScoringHitCastSpellTag             = this.onScoringHitCastSpellTag;
            copy.onDeathIBScript                      = this.onDeathIBScript;
            copy.onDeathIBScriptParms                 = this.onDeathIBScriptParms;
            copy.cr_effectsList                       = new List <Effect>();
            copy.newCoor                              = this.newCoor;
            copy.glideAdderX                          = this.glideAdderX;
            copy.glideAdderY                          = this.glideAdderY;
            copy.hpLastTurn                           = this.hpLastTurn;
            copy.labelForCastAction                   = this.labelForCastAction;
            copy.labelForSpellsButtonInCombat         = this.labelForSpellsButtonInCombat;
            copy.creatureSize                         = this.creatureSize;
            copy.spRegenerationPerRound               = this.spRegenerationPerRound;
            copy.hpRegenerationPerRound               = this.hpRegenerationPerRound;

            copy.knownSpellsTags = new List <string>();
            foreach (string s in this.knownSpellsTags)
            {
                copy.knownSpellsTags.Add(s);
            }

            copy.castChances = new List <LocalInt>();
            foreach (LocalInt l in this.castChances)
            {
                LocalInt Lint = new LocalInt();
                Lint.Key   = l.Key;
                Lint.Value = l.Value;
                copy.castChances.Add(Lint);
                //copy.castChances.Add(s);
            }

            /*
             * bool useCastChances = true;
             * foreach (LocalInt l in this.castChances)
             *
             * if (copy.castChances.Count < 1)
             * {
             *  foreach (string s in copy.knownSpellsTags)
             *  {
             *      copy.castChances.Add(100);
             *  }
             * }
             */

            //public List<Coordinate> tokenCoveredSquares = new List<Coordinate>();
            copy.tokenCoveredSquares = new List <Coordinate>();
            foreach (Coordinate c in this.tokenCoveredSquares)
            {
                copy.tokenCoveredSquares.Add(c);
            }

            copy.CreatureLocalInts = new List <LocalInt>();
            foreach (LocalInt l in this.CreatureLocalInts)
            {
                LocalInt Lint = new LocalInt();
                Lint.Key   = l.Key;
                Lint.Value = l.Value;
                copy.CreatureLocalInts.Add(Lint);
            }

            copy.CreatureLocalStrings = new List <LocalString>();
            foreach (LocalString l in this.CreatureLocalStrings)
            {
                LocalString Lstr = new LocalString();
                Lstr.Key   = l.Key;
                Lstr.Value = l.Value;
                copy.CreatureLocalStrings.Add(Lstr);
            }

            copy.requiredWeaponTypesToHarmCreature = new List <LocalString>();
            foreach (LocalString l in this.requiredWeaponTypesToHarmCreature)
            {
                LocalString Lstr = new LocalString();
                Lstr.Key   = l.Key;
                Lstr.Value = l.Value;
                copy.requiredWeaponTypesToHarmCreature.Add(Lstr);
            }
            return(copy);
        }
Пример #4
0
 public Prop DeepCopy()
 {
     Prop copy = new Prop();
     copy.LocationX = this.LocationX;
     copy.LocationY = this.LocationY;
     copy.ImageFileName = this.ImageFileName;
     copy.PropFacingLeft = this.PropFacingLeft;
     copy.MouseOverText = this.MouseOverText;
     copy.HasCollision = this.HasCollision;
     copy.isShown = this.isShown;
     copy.isActive = this.isActive;
     copy.PropTag = this.PropTag;
     copy.PropCategoryName = this.PropCategoryName;
     copy.ConversationWhenOnPartySquare = this.ConversationWhenOnPartySquare;
     copy.EncounterWhenOnPartySquare = this.EncounterWhenOnPartySquare;
     copy.DeletePropWhenThisEncounterIsWon = this.DeletePropWhenThisEncounterIsWon;
     copy.PropLocalInts = new List<LocalInt>();
     foreach (LocalInt l in this.PropLocalInts)
     {
         LocalInt Lint = new LocalInt();
         Lint.Key = l.Key;
         Lint.Value = l.Value;
         copy.PropLocalInts.Add(Lint);
     }
     copy.PropLocalStrings = new List<LocalString>();
     foreach (LocalString l in this.PropLocalStrings)
     {
         LocalString Lstr = new LocalString();
         Lstr.Key = l.Key;
         Lstr.Value = l.Value;
         copy.PropLocalStrings.Add(Lstr);
     }
     //PROJECT LIVING WORLD STUFF
     copy.PostLocationX = this.PostLocationX;
     copy.PostLocationY = this.PostLocationY;
     copy.WayPointList = new List<WayPoint>();
     foreach (WayPoint coor in this.WayPointList)
     {
         WayPoint c = new WayPoint();
         c.X = coor.X;
         c.Y = coor.Y;
         copy.WayPointList.Add(c);
     }
     copy.WayPointListCurrentIndex = this.WayPointListCurrentIndex;
     copy.isMover = this.isMover;
     copy.ChanceToMove2Squares = this.ChanceToMove2Squares;
     copy.ChanceToMove0Squares = this.ChanceToMove0Squares;
     copy.MoverType = this.MoverType;
     copy.CurrentMoveToTarget = new Coordinate(this.CurrentMoveToTarget.X, this.CurrentMoveToTarget.Y);
     copy.isChaser = this.isChaser;
     copy.isCurrentlyChasing = this.isCurrentlyChasing;
     copy.ChaserDetectRangeRadius = this.ChaserDetectRangeRadius;
     copy.ChaserGiveUpChasingRangeRadius = this.ChaserGiveUpChasingRangeRadius;
     copy.ChaserChaseDuration = this.ChaserChaseDuration;
     copy.ChaserStartChasingTime = this.ChaserStartChasingTime;
     copy.RandomMoverRadius = this.RandomMoverRadius;
     copy.OnHeartBeatLogicTree = this.OnHeartBeatLogicTree;
     copy.OnHeartBeatParms = this.OnHeartBeatLogicTree;
     return copy;
 }
Пример #5
0
        public Prop DeepCopy()
        {
            Prop copy = new Prop();

            //TODO
            copy.lightRadius = lightRadius;
            copy.lightColor  = lightColor;
            copy.allowEnteringOccupiedSquare = allowEnteringOccupiedSquare;
            copy.stealthModifier             = this.stealthModifier;
            copy.skippedPathfinding          = skippedPathfinding;
            copy.blockConvoForOneTurn        = blockConvoForOneTurn;
            copy.justJumpedBetweenAreas      = justJumpedBetweenAreas;
            copy.relocX = relocX;
            copy.relocY = relocY;
            copy.lastAreaFilenameOfProp = lastAreaFilenameOfProp;
            copy.isPausing                = isPausing;
            copy.pauseCounter             = pauseCounter;
            copy.skipNavigationThisTurn   = skipNavigationThisTurn;
            copy.propMovingHalfSpeedMulti = propMovingHalfSpeedMulti;
            copy.timeSinceLastFloaty      = timeSinceLastFloaty;

            copy.currentWalkingSpeed         = currentWalkingSpeed;
            copy.breathAnimationDelayCounter = breathAnimationDelayCounter;
            copy.showBreathingFrame          = showBreathingFrame;
            copy.walkAnimationDelayCounter   = walkAnimationDelayCounter;
            copy.showWalkingFrame            = showWalkingFrame;
            copy.idleAnimationDelayCounter   = idleAnimationDelayCounter;
            copy.showIdlingFrame             = showIdlingFrame;
            copy.hurdle = hurdle;

            copy.isBroken            = isBroken;
            copy.isPureBreakableProp = isPureBreakableProp;
            //copy.isDiggableIndicatorProp = isDiggableIndicatorProp;
            copy.requiredItemInInventory = requiredItemInInventory; //like eg pick axes of varying qualities
            copy.breakableTraitTag       = breakableTraitTag;
            copy.breakableDC             = breakableDC;
            copy.numberOfStages          = numberOfStages;
            copy.debrisGraphic           = debrisGraphic;
            copy.stageGraphic1           = stageGraphic1;
            copy.stageGraphic2           = stageGraphic2;
            copy.stageGraphic3           = stageGraphic3;
            copy.resRefOfItemGained      = resRefOfItemGained;
            copy.nameOfSoundFileBump     = nameOfSoundFileBump;
            copy.nameOfSoundFileBreak    = nameOfSoundFileBreak;

            copy.counterStages = counterStages;


            copy.gridHasTimeLimit           = gridHasTimeLimit;
            copy.turnsBeforeGridResets      = turnsBeforeGridResets;
            copy.timerTurnsBeforeGridResets = timerTurnsBeforeGridResets;
            copy.gridIsCompleted            = gridIsCompleted;
            copy.isLever                = isLever;
            copy.isOn                   = isOn;
            copy.nameOfBitmapON         = nameOfBitmapON;
            copy.nameOfBitmapOFF        = nameOfBitmapOFF;
            copy.keyOFGlobalIntToChange = keyOFGlobalIntToChange;
            copy.valueOfGlobalIntOFF    = valueOfGlobalIntOFF;
            copy.valueOfGlobalIntON     = valueOfGlobalIntON;

            //1.pushable grid properties (04f - STEP: Pushable grid)
            //copy.isGridForPushableObject = isGridForPushableObject;
            //copy.showPushableGridOutline = showPushableGridOutline;
            copy.completionStateCanBeLostAgain         = completionStateCanBeLostAgain;
            copy.keyOfFirstGlobalIntThatControllsDoor  = keyOfFirstGlobalIntThatControllsDoor;
            copy.valueOfFirstGlobalIntThatOpensDoor    = valueOfFirstGlobalIntThatOpensDoor;
            copy.keyOfSecondGlobalIntThatControllsDoor = keyOfSecondGlobalIntThatControllsDoor;
            copy.valueOfSecondGlobalIntThatOpensDoor   = valueOfSecondGlobalIntThatOpensDoor;
            copy.keyOfThirdGlobalIntThatControllsDoor  = keyOfThirdGlobalIntThatControllsDoor;
            copy.valueOfThirdGlobalIntThatOpensDoor    = valueOfThirdGlobalIntThatOpensDoor;
            copy.keyOfFourthGlobalIntThatControllsDoor = keyOfFourthGlobalIntThatControllsDoor;
            copy.valueOfFourthGlobalIntThatOpensDoor   = valueOfFourthGlobalIntThatOpensDoor;
            copy.keyOfFifthGlobalIntThatControllsDoor  = keyOfFifthGlobalIntThatControllsDoor;
            copy.valueOfFifthGlobalIntThatOpensDoor    = valueOfFifthGlobalIntThatOpensDoor;

            copy.keyOfFirstGlobalIntThatControllsChest = keyOfFirstGlobalIntThatControllsChest;
            copy.valueOfFirstGlobalIntThatOpensChest   = valueOfFirstGlobalIntThatOpensChest;

            copy.keyOfSecondGlobalIntThatControllsChest = keyOfSecondGlobalIntThatControllsChest;
            copy.valueOfSecondGlobalIntThatOpensChest   = valueOfSecondGlobalIntThatOpensChest;
            copy.keyOfThirdGlobalIntThatControllsChest  = keyOfThirdGlobalIntThatControllsChest;
            copy.valueOfThirdGlobalIntThatOpensChest    = valueOfThirdGlobalIntThatOpensChest;
            copy.keyOfFourthGlobalIntThatControllsChest = keyOfFourthGlobalIntThatControllsChest;
            copy.valueOfFourthGlobalIntThatOpensChest   = valueOfFourthGlobalIntThatOpensChest;
            copy.keyOfFifthGlobalIntThatControllsChest  = keyOfFifthGlobalIntThatControllsChest;
            copy.valueOfFifthGlobalIntThatOpensChest    = valueOfFifthGlobalIntThatOpensChest;

            copy.partyDefaultDrawDirection                          = partyDefaultDrawDirection;
            copy.pushableGridCanBeResetViaHotkey                    = pushableGridCanBeResetViaHotkey;
            copy.pushableGridCanBeResetEvenAfterCompletion          = pushableGridCanBeResetEvenAfterCompletion;
            copy.partyDefaultPushableGridPositionX                  = partyDefaultPushableGridPositionX;
            copy.partyDefaultPushableGridPositionY                  = partyDefaultPushableGridPositionY;
            copy.allPushableGridTargetPositionsAreShared            = allPushableGridTargetPositionsAreShared;
            copy.keyOfGlobalIntToChangeUponPushableGridCompletion   = keyOfGlobalIntToChangeUponPushableGridCompletion;
            copy.valueOfGlobalIntToChangeUponPushableGridCompletion = valueOfGlobalIntToChangeUponPushableGridCompletion;
            copy.keyOfGlobalIntToChangeUponPushableGridFailure      = keyOfGlobalIntToChangeUponPushableGridFailure;
            copy.valueOfGlobalIntToChangeUponPushableGridFailure    = valueOfGlobalIntToChangeUponPushableGridFailure;
            copy.pushableGridIsResetOnEachFailure                   = pushableGridIsResetOnEachFailure;
            copy.lockGridOnCompletion   = lockGridOnCompletion;
            copy.removeGridOnCompletion = removeGridOnCompletion;
            copy.messageOnCompletion    = messageOnCompletion;
            copy.lockGridOnFailure      = lockGridOnFailure;
            copy.removeGridOnFailure    = removeGridOnFailure;
            copy.messageOnFailure       = messageOnFailure;

            //2.pushable object properties (04f - STEP: Pushable object)
            copy.isPushable              = isPushable;
            copy.pushableGridTriggerTag  = pushableGridTriggerTag;
            copy.pushableStartPositionX  = pushableStartPositionX;
            copy.pushableStartPositionY  = pushableStartPositionY;
            copy.pushableTargetPositionX = pushableTargetPositionX;
            copy.pushableTargetPositionY = pushableTargetPositionY;
            copy.pushableTraitTag        = pushableTraitTag;
            copy.pushableDC              = pushableDC;

            copy.isClimbable            = this.isClimbable;
            copy.climbDirection         = this.climbDirection;
            copy.climbDC                = this.climbDC;
            copy.climbTrait             = this.climbTrait;
            copy.moved2                 = this.moved2;
            copy.showSneakThroughSymbol = this.showSneakThroughSymbol;
            copy.challengeLevelAssignedForEncounterInConvo = this.challengeLevelAssignedForEncounterInConvo;
            copy.alwaysFlagAsEncounter = this.alwaysFlagAsEncounter;
            copy.ingameShownEncName    = this.ingameShownEncName;
            copy.isDoor = this.isDoor;
            copy.differentSpriteWhenOpen = this.differentSpriteWhenOpen;

            copy.isContainer  = this.isContainer;
            copy.containerTag = this.containerTag;

            copy.isHiddenInfo      = this.isHiddenInfo;
            copy.floatyAndLogText  = this.floatyAndLogText;
            copy.conversationName  = this.conversationName;
            copy.boxText           = this.boxText;
            copy.infoDC            = this.infoDC;
            copy.infoTraitTag      = this.infoTraitTag;
            copy.showOnlyOnce      = this.showOnlyOnce;
            copy.globalStringKey   = this.globalStringKey;
            copy.globalStringValue = this.globalStringValue;

            copy.scriptFilename           = this.scriptFilename;
            copy.parm1                    = this.parm1;
            copy.parm2                    = this.parm2;
            copy.parm3                    = this.parm3;
            copy.parm4                    = this.parm4;
            copy.onlyOnce                 = this.onlyOnce;
            copy.scriptActivationFloaty   = this.scriptActivationFloaty;
            copy.scriptActivationLogEntry = this.scriptActivationLogEntry;

            copy.isTrapMain   = this.isTrapMain;
            copy.trapDC       = this.trapDC;
            copy.trapTraitTag = this.trapTraitTag;

            copy.isSecretDoor       = this.isSecretDoor;
            copy.secretDoorDC       = this.secretDoorDC;
            copy.secretDoorTraitTag = this.secretDoorTraitTag;


            //copy.secretDoorDirectionEW = this.secretDoorDirectionEW;
            copy.wasKilled = this.wasKilled;
            copy.stealthSkipsPropTriggers = this.stealthSkipsPropTriggers;
            copy.isStealthed = this.isStealthed;
            //copy.token = this.token;
            copy.spotEnemy                            = this.spotEnemy;
            copy.stealth                              = this.stealth;
            copy.movementSpeed                        = this.movementSpeed;
            copy.permanentText                        = this.permanentText;
            copy.alwaysDrawNormalSize                 = this.alwaysDrawNormalSize;
            copy.encounterPropTriggerOnEveryStep      = this.encounterPropTriggerOnEveryStep;
            copy.pendingFactionStrengthEffectReversal = this.pendingFactionStrengthEffectReversal;
            copy.spawnLocationX                       = this.spawnLocationX;
            copy.spawnLocationY                       = this.spawnLocationY;
            copy.spawnLocationZ                       = this.spawnLocationZ;
            copy.spawnArea                            = this.spawnArea;
            copy.allowLastLocationUpdate              = this.allowLastLocationUpdate;
            copy.isLight                              = this.isLight;
            copy.inverseAnimationDirection            = this.inverseAnimationDirection;
            copy.randomAnimationDirectionEachCall     = this.randomAnimationDirectionEachCall;
            copy.hasHalo                              = this.hasHalo;
            copy.focalIntensity                       = this.focalIntensity;
            copy.ringIntensity                        = this.ringIntensity;
            copy.LocationX                            = this.LocationX;
            copy.LocationY                            = this.LocationY;
            copy.LocationZ                            = this.LocationZ;
            copy.blockTrigger                         = this.blockTrigger;
            copy.wasTriggeredLastUpdate               = this.wasTriggeredLastUpdate;
            copy.lastLocationX                        = this.lastLocationX;
            copy.lastLocationY                        = this.lastLocationY;
            copy.priorLastLocationX                   = this.lastLocationX;
            copy.priorLastLocationY                   = this.lastLocationY;
            copy.lastLocationZ                        = this.lastLocationZ;
            copy.ImageFileName                        = this.ImageFileName;
            copy.PropFacingLeft                       = this.PropFacingLeft;
            copy.MouseOverText                        = this.MouseOverText;
            copy.HasCollision                         = this.HasCollision;
            copy.isShown                              = this.isShown;
            copy.isActive                             = this.isActive;
            copy.PropTag                              = this.PropTag;
            copy.PropCategoryName                     = this.PropCategoryName;
            copy.ConversationWhenOnPartySquare        = this.ConversationWhenOnPartySquare;
            copy.EncounterWhenOnPartySquare           = this.EncounterWhenOnPartySquare;
            copy.DeletePropWhenThisEncounterIsWon     = this.DeletePropWhenThisEncounterIsWon;
            //copy.PropLocalInts = new List<LocalInt>();
            //copy.OnEnterSquareIBScriptParms = this.OnEnterSquareIBScriptParms;
            copy.OnEnterSquareScript          = this.OnEnterSquareScript;
            copy.OnEnterSquareScriptParm1     = this.OnEnterSquareScriptParm1;
            copy.OnEnterSquareScriptParm2     = this.OnEnterSquareScriptParm1;
            copy.OnEnterSquareScriptParm3     = this.OnEnterSquareScriptParm1;
            copy.OnEnterSquareScriptParm4     = this.OnEnterSquareScriptParm1;
            copy.canBeTriggeredByPc           = this.canBeTriggeredByPc;
            copy.canBeTriggeredByCreature     = this.canBeTriggeredByCreature;
            copy.numberOfScriptCallsRemaining = this.numberOfScriptCallsRemaining;
            copy.PropLocalInts = new List <LocalInt>();
            foreach (LocalInt l in this.PropLocalInts)
            {
                LocalInt Lint = new LocalInt();
                Lint.Key   = l.Key;
                Lint.Value = l.Value;
                copy.PropLocalInts.Add(Lint);
            }
            copy.PropLocalStrings = new List <LocalString>();
            foreach (LocalString l in this.PropLocalStrings)
            {
                LocalString Lstr = new LocalString();
                Lstr.Key   = l.Key;
                Lstr.Value = l.Value;
                copy.PropLocalStrings.Add(Lstr);
            }
            //PROJECT LIVING WORLD STUFF
            copy.PostLocationX = this.PostLocationX;
            copy.PostLocationY = this.PostLocationY;
            copy.oldPath       = new List <Coordinate>();
            foreach (Coordinate Coor in this.oldPath)
            {
                Coordinate c = new Coordinate();
                c.X = Coor.X;
                c.Y = Coor.Y;
                copy.oldPath.Add(c);
            }
            copy.WayPointList = new List <WayPoint>();
            foreach (WayPoint coor in this.WayPointList)
            {
                WayPoint c = new WayPoint();
                c.X             = coor.X;
                c.Y             = coor.Y;
                c.areaName      = coor.areaName;
                c.departureTime = coor.departureTime;
                //List<BarkString> blAT = new List<BarkString>();
                //List<BarkString> blON = new List<BarkString>();
                foreach (BarkString bAT in coor.BarkStringsAtWayPoint)
                {
                    c.BarkStringsAtWayPoint.Add(bAT.DeepCopy());
                }
                foreach (BarkString bON in coor.BarkStringsOnTheWayToNextWayPoint)
                {
                    c.BarkStringsOnTheWayToNextWayPoint.Add(bON.DeepCopy());
                }
                copy.WayPointList.Add(c);
            }
            copy.WayPointListCurrentIndex = this.WayPointListCurrentIndex;
            copy.isMover = this.isMover;
            copy.ChanceToMove2Squares           = this.ChanceToMove2Squares;
            copy.ChanceToMove0Squares           = this.ChanceToMove0Squares;
            copy.MoverType                      = this.MoverType;
            copy.CurrentMoveToTarget            = new Coordinate(this.CurrentMoveToTarget.X, this.CurrentMoveToTarget.Y);
            copy.isChaser                       = this.isChaser;
            copy.isCurrentlyChasing             = this.isCurrentlyChasing;
            copy.ChaserDetectRangeRadius        = this.ChaserDetectRangeRadius;
            copy.ChaserGiveUpChasingRangeRadius = this.ChaserGiveUpChasingRangeRadius;
            copy.ChaserChaseDuration            = this.ChaserChaseDuration;
            copy.ChaserStartChasingTime         = this.ChaserStartChasingTime;
            copy.RandomMoverRadius              = this.RandomMoverRadius;
            //copy.OnHeartBeatLogicTree = this.OnHeartBeatLogicTree;
            //copy.OnHeartBeatParms = this.OnHeartBeatParms;
            copy.OnHeartBeatIBScript      = this.OnHeartBeatIBScript;
            copy.OnHeartBeatIBScriptParms = this.OnHeartBeatIBScriptParms;
            copy.passOneMove = this.passOneMove;
            copy.randomMoverTimerForNextTarget = this.randomMoverTimerForNextTarget;
            copy.lengthOfLastPath              = this.lengthOfLastPath;
            copy.unavoidableConversation       = this.unavoidableConversation;
            copy.destinationPixelPositionXList = this.destinationPixelPositionXList;
            copy.destinationPixelPositionYList = this.destinationPixelPositionYList;
            copy.currentPixelPositionX         = this.currentPixelPositionX;
            copy.currentPixelPositionY         = this.currentPixelPositionY;
            copy.pixelMoveSpeed = this.pixelMoveSpeed;
            //copy.drawAnchorX = this.drawAnchorX;
            //copy.drawAnchorY = this.drawAnchorY;
            //copy.startingOnVisibleSquare = this.startingOnVisibleSquare;

            copy.roamDistanceX         = this.roamDistanceX;
            copy.roamDistanceY         = this.roamDistanceY;
            copy.straightLineDistanceX = this.straightLineDistanceX;
            copy.straightLineDistanceY = this.straightLineDistanceY;
            copy.goDown        = this.goDown;
            copy.goRight       = this.goRight;
            copy.inactiveTimer = this.inactiveTimer;

            copy.isUnderBridge = this.isUnderBridge;

            //prop animation variables
            copy.maxNumberOfFrames              = this.maxNumberOfFrames;
            copy.currentFrameNumber             = this.currentFrameNumber;
            copy.animationDelayCounter          = this.animationDelayCounter;
            copy.updateTicksNeededTillNextFrame = this.updateTicksNeededTillNextFrame;
            copy.chanceToTriggerAnimationCycle  = this.chanceToTriggerAnimationCycle;
            copy.animationComplete              = this.animationComplete;
            copy.normalizedTime      = this.normalizedTime;
            copy.propFrameHeight     = this.propFrameHeight;
            copy.hiddenWhenComplete  = this.hiddenWhenComplete;
            copy.sizeFactor          = this.sizeFactor;
            copy.doOnce              = this.doOnce;
            copy.animationIsActive   = this.animationIsActive;
            copy.hiddenWhenNotActive = this.hiddenWhenNotActive;
            copy.drawAnimatedProp    = this.drawAnimatedProp;
            copy.numberOfCyclesNeededForCompletion = this.numberOfCyclesNeededForCompletion;
            copy.cycleCounter = this.cycleCounter;
            copy.framesNeededForFullFadeInOut  = this.framesNeededForFullFadeInOut;
            copy.totalFramesInWholeLoopCounter = this.totalFramesInWholeLoopCounter;
            copy.opacity = this.opacity;

            copy.OnEnterSquareIBScript      = this.OnEnterSquareIBScript;
            copy.OnEnterSquareIBScriptParms = this.OnEnterSquareIBScriptParms;
            copy.isTrap = this.isTrap;
            copy.trapDCforDisableCheck = this.trapDCforDisableCheck;

            //faction and respawn systems
            copy.respawnTimeInHours  = this.respawnTimeInHours;                                              //-1 meaning false, respawn time is in hours
            copy.maxNumberOfRespawns = this.maxNumberOfRespawns;                                             //-1 meaning no limit to the number of respawns
            //copy.spawnOnNearbySquaresIfOccupied = this.spawnOnNearbySquaresIfOccupied; //if false, the respawn will be delayed until target square is free
            copy.respawnTimeInMinutesPassedAlready   = this.respawnTimeInMinutesPassedAlready;               //internal property, not for toolset
            copy.numberOfRespawnsThatHappenedAlready = this.numberOfRespawnsThatHappenedAlready;             //internal property, not for toolset
            copy.nameAsMaster              = this.nameAsMaster;                                              // blank meaning this prop is master of none
            copy.thisPropsMaster           = this.thisPropsMaster;                                           //blank means this prop has no master; refers to nameAsMaster of another prop
            copy.instantDeathOnMasterDeath = this.instantDeathOnMasterDeath;                                 //if true,the propsis immediately placed on List<Prop> propsWaitingForRespawn of this module on its master's death
            copy.keyOfGlobalVarToSetTo1OnDeathOrInactivity = this.keyOfGlobalVarToSetTo1OnDeathOrInactivity; //set to zero again when living and active

            //faction:
            copy.factionTag = this.factionTag;
            copy.requiredFactionStrength      = this.requiredFactionStrength;
            copy.maxFactionStrength           = this.maxFactionStrength;
            copy.worthForOwnFaction           = this.worthForOwnFaction;
            copy.otherFactionAffectedOnDeath1 = this.otherFactionAffectedOnDeath1;
            copy.effectOnOtherFactionOnDeath1 = this.effectOnOtherFactionOnDeath1;
            copy.otherFactionAffectedOnDeath2 = this.otherFactionAffectedOnDeath2;
            copy.effectOnOtherFactionOnDeath2 = this.effectOnOtherFactionOnDeath2;
            copy.otherFactionAffectedOnDeath3 = this.otherFactionAffectedOnDeath3;
            copy.effectOnOtherFactionOnDeath3 = this.effectOnOtherFactionOnDeath3;
            copy.otherFactionAffectedOnDeath4 = this.otherFactionAffectedOnDeath4;
            copy.effectOnOtherFactionOnDeath4 = this.effectOnOtherFactionOnDeath4;

            //gcCheck
            copy.firstGcScriptName          = this.firstGcScriptName;
            copy.firstGcParm1               = this.firstGcParm1;
            copy.firstGcParm2               = this.firstGcParm2;
            copy.firstGcParm3               = this.firstGcParm3;
            copy.firstGcParm4               = this.firstGcParm4;
            copy.firstCheckForConditionFail = this.firstCheckForConditionFail;

            copy.secondGcScriptName          = this.secondGcScriptName;
            copy.secondGcParm1               = this.secondGcParm1;
            copy.secondGcParm2               = this.secondGcParm2;
            copy.secondGcParm3               = this.secondGcParm3;
            copy.secondGcParm4               = this.secondGcParm4;
            copy.secondCheckForConditionFail = this.secondCheckForConditionFail;

            copy.thirdGcScriptName          = this.thirdGcScriptName;
            copy.thirdGcParm1               = this.thirdGcParm1;
            copy.thirdGcParm2               = this.thirdGcParm2;
            copy.thirdGcParm3               = this.thirdGcParm3;
            copy.thirdGcParm4               = this.thirdGcParm4;
            copy.thirdCheckForConditionFail = this.thirdCheckForConditionFail;


            copy.allConditionsMustBeTrue = this.allConditionsMustBeTrue;

            return(copy);
        }
Пример #6
0
        public void SetLocalInt(string objectTag, string variableName, string val)
        {
            int value = 0;
            if (val.Equals("++"))
            {
                int currentValue = GetLocalInt(objectTag, variableName);
                if (currentValue == -1) //this is our first time using this variable so set to 1
                {
                    value = 1;
                }
                else //we have the variable so increment by one
                {
                    currentValue++;
                    value = currentValue;
                }
            }
            else if (val.Equals("--"))
            {
                int currentValue = GetLocalInt(objectTag, variableName);
                if (currentValue == -1) //this is our first time using this variable so set to 0
                {
                    value = 0;
                }
                else //we have the variable so decrement by one
                {
                    currentValue--;
                    if (currentValue < 0) { currentValue = 0; }
                    value = currentValue;
                }
            }
            else
            {
                value = Convert.ToInt32(val);
            }

            //check creatures and areas and props
            foreach (Area a in mod.moduleAreasObjects)
            {
                if (a.Filename.Equals(objectTag))
                {
                    int exists = 0;
                    foreach (LocalInt variable in a.AreaLocalInts)
                    {
                        if (variable.Key.Equals(variableName))
                        {
                            variable.Value = value;
                            exists = 1;
                        }
                    }
                    if (exists == 0)
                    {
                        LocalInt newLocalInt = new LocalInt();
                        newLocalInt.Key = variableName;
                        newLocalInt.Value = value;
                        a.AreaLocalInts.Add(newLocalInt);
                    }
                    return;
                }
                else
                {
                    foreach (Prop p in a.Props)
                    {
                        if (p.PropTag.Equals(objectTag))
                        {
                            int exists = 0;
                            foreach (LocalInt variable in p.PropLocalInts)
                            {
                                if (variable.Key.Equals(variableName))
                                {
                                    variable.Value = value;
                                    exists = 1;
                                }
                            }
                            if (exists == 0)
                            {
                                LocalInt newLocalInt = new LocalInt();
                                newLocalInt.Key = variableName;
                                newLocalInt.Value = value;
                                p.PropLocalInts.Add(newLocalInt);
                            }
                            return;
                        }
                    }
                }
            }
            foreach (Creature cr in mod.currentEncounter.encounterCreatureList)
            {
                if (cr.cr_tag.Equals(objectTag))
                {
                    int exists = 0;
                    foreach (LocalInt variable in cr.CreatureLocalInts)
                    {
                        if (variable.Key.Equals(variableName))
                        {
                            variable.Value = value;
                            exists = 1;
                        }
                    }
                    if (exists == 0)
                    {
                        LocalInt newLocalInt = new LocalInt();
                        newLocalInt.Key = variableName;
                        newLocalInt.Value = value;
                        cr.CreatureLocalInts.Add(newLocalInt);
                    }
                    return;
                }
            }
            if (mod.debugMode)
            {
                gv.cc.addLogText("<font color='yellow'>" + objectTag + " setLocal: " + variableName + " = " + value + "</font><BR>");
            }
        }
Пример #7
0
        public Creature DeepCopy()
        {
            Creature copy = new Creature();
            copy.cr_tokenFilename = this.cr_tokenFilename;
            copy.combatFacingLeft = this.combatFacingLeft;
            copy.combatLocX = this.combatLocX;
            copy.combatLocY = this.combatLocY;
            copy.cr_name = this.cr_name;
            copy.cr_tag = this.cr_tag;
            copy.cr_resref = this.cr_resref;
            copy.cr_desc = this.cr_desc;
            copy.cr_level = this.cr_level;
            copy.hp = this.hp;
            copy.hpMax = this.hpMax;
            copy.sp = this.sp;
            copy.cr_XP = this.cr_XP;
            copy.AC = this.AC;
            copy.cr_status = this.cr_status;
            copy.cr_att = this.cr_att;
            copy.cr_attRange = this.cr_attRange;
            copy.cr_damageNumDice = this.cr_damageNumDice;
            copy.cr_damageDie = this.cr_damageDie;
            copy.cr_damageAdder = this.cr_damageAdder;
            copy.cr_category = this.cr_category;
            copy.cr_projSpriteFilename = this.cr_projSpriteFilename;
            copy.cr_spriteEndingFilename = this.cr_spriteEndingFilename;
            copy.cr_attackSound = this.cr_attackSound;
            copy.cr_numberOfAttacks = this.cr_numberOfAttacks;
            copy.cr_ai = this.cr_ai;
            copy.fortitude = this.fortitude;
            copy.will = this.will;
            copy.reflex = this.reflex;
            copy.damageTypeResistanceValueAcid = this.damageTypeResistanceValueAcid;
            copy.damageTypeResistanceValueNormal = this.damageTypeResistanceValueNormal;
            copy.damageTypeResistanceValueCold = this.damageTypeResistanceValueCold;
            copy.damageTypeResistanceValueElectricity = this.damageTypeResistanceValueElectricity;
            copy.damageTypeResistanceValueFire = this.damageTypeResistanceValueFire;
            copy.damageTypeResistanceValueMagic = this.damageTypeResistanceValueMagic;
            copy.damageTypeResistanceValuePoison = this.damageTypeResistanceValuePoison;
            copy.cr_typeOfDamage = this.cr_typeOfDamage;
            copy.onScoringHit = this.onScoringHit;
            copy.onScoringHitParms = this.onScoringHitParms;
            copy.onDeathLogicTree = this.onDeathLogicTree;
            copy.onDeathParms = this.onDeathParms;
            copy.cr_effectsList = new List<Effect>();

            copy.knownSpellsTags = new List<string>();
            foreach (string s in this.knownSpellsTags)
            {
                copy.knownSpellsTags.Add(s);
            }

            copy.CreatureLocalInts = new List<LocalInt>();
            foreach (LocalInt l in this.CreatureLocalInts)
            {
                LocalInt Lint = new LocalInt();
                Lint.Key = l.Key;
                Lint.Value = l.Value;
                copy.CreatureLocalInts.Add(Lint);
            }

            copy.CreatureLocalStrings = new List<LocalString>();
            foreach (LocalString l in this.CreatureLocalStrings)
            {
                LocalString Lstr = new LocalString();
                Lstr.Key = l.Key;
                Lstr.Value = l.Value;
                copy.CreatureLocalStrings.Add(Lstr);
            }
            return copy;
        }