示例#1
0
        //Don't just copy and paste everything in this code.
        //Do mind that I'm not really a digifan, so take It easy if something is incorrect based on the anime/games.
        public GaomonBase()
        {
            Name         = "Gaomon";
            Description  = "Came from another world by unknown ways."; //Set the description of the companion, that is shown when selecting this companion from your list.
            SpriteWidth  = SpriteHeight = 64;                          //When creating a companion sprite sheet, never let It's total width or height exceed 2000, for some reason that causes bugs to XNA.
            FramesInRows = 20;                                         //Set here the maximum number of frames a row will have, until skip the animation to the next row.
            //SpritesDirectory = ""; //Here, you can set the path from the mod root folder, until the folder this companion sprites are located. Since this companion didn't used a different directory pathing, I don't need to setup this.
            /// Still related to sprite directories. If you're making a custom companion, like a TerraGuardian, the default directory is: "Companions/Creatures".
            /// As for Terrarian companions, it's "Companions/Terrarians".
            /// I could have change the directory this companion location to "Companions/Digimon" instead, but due to this being a example companion, I didn't do that.
            Width  = 18; //Hitbox Width based on the sprite center.
            Height = 32; //Hitbox Height based on sprite bottom.
            //DuckingHeight = 32; //Height when companion is crouching.
            SetTerraGuardian();
            GroupID         = MainMod.DigimonGroupID; //Set group ids AFTER you use SetTerraGuardian() or SetTerrarian(). Those methods overrides GroupID by default.
            Size            = GuardianSize.Medium;    //Things like the wind push from the sandstorm affecting the companion are related ot this.
            Age             = 0;                      //Lorewise, give them some average age, for immersion. Due to this companion just appearing after you use the Digivice, literally It's age is 0 (beside I wont try explaining why he spawns on child stage).
            CanChangeGender = true;                   //Tells that the companion may be male or female.
            //Male = true; //Tells the companion gender. King and Queen Statue makes use of this. Some future dialogues may make use of It too.
            InitialMHP         = 140;                 //480 - Initial Health the companion starts with. The 480 I placed on comment is the total health when all life crystals and life fruits the companion will have. It's good if you log It too.
            LifeCrystalHPBonus = 16;                  //How much max health bonus each life crystal will give. Remember that a maximum of 15 life crystals can be used by the companion.
            LifeFruitHPBonus   = 6;                   //How much max health bonus each Life Fruit will give. Remember that a maximum of 20 life fruits can be used by the companion.
            //CalculateHealthToGive(480, 0.5f,0.5f); //If you are lazy to calculate the max health given by each life increasing item, you can use this method instead.
            //InitialMP = 20; //Initial MP the companion has.
            //ManaCrystalMPBonus = 20; //Extra MP the companion will get for using Mana Crystal. Remember that they can use up to 9.
            DodgeRate           = 5;     //Default dodge rate of the companion. Default is 0.
            BlockRate           = 0;     //Default block rate of the companion. Default is 0.
            DrinksBeverage      = false; //Drinks alcoholic stuffs?
            CanDuck             = false; //Tells if companion can crouch or not.
            ReverseMount        = true;  //Tells the game that the follower will mount on your character back, instead of the inverse.
            DontUseHeavyWeapons = true;  //The companion will not use heavy weapons, like the heavy swords the mod adds.
            //There are other settings you can make use of, just check out GuardianBase class on TerraGuardians mod.

            CallUnlockLevel = 0; //Level necessary to be able to call your companion for help. 0 = always possible. 255 = most likelly never possible.
            //LootingUnlockLevel = 3; //Companion loot unlock level.
            //MaySellYourLoot = 4; //Loot selling unlock level.
            //MountUnlockLevel = 5; //Mount unlock level.
            //StopMindingAFK = 7; //Level necessary for the follower to stop minding afk.
            //MountDamageReductionLevel = 9; //Level to have a damage reduction when mounted on follower.
            //ControlUnlockLevel = 10; //Level to unlock companion control.
            //FriendshipBondUnlockLevel = 12; //Level to get status bonus based on friendship level.
            //FallDamageReductionLevel = 15; //Level to unlock fall damage reduction.

            StandingFrame = 0;
            WalkingFrames = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            JumpFrame     = 9;
            ItemUseFrames = new int[] { 10, 11, 12, 13 };
            //Past here is optional, but animation bugs will happen If you don't make a sprite. (Ex:. Companion standing when you share mount)
            //For Sitting and Chair Sitting frames, sprite them on the same sitting point.
            //PlayerMountedArmAnimation = 0; //If ReverseMount is off, sets the frame the companion arm will be used for when the player is mounting on companion. By default, uses the jump frame.
            SittingFrame       = 14; //Animation when companion is sitting on your mount. Also used by ReverseMount. Add a BodyFront frame for this, so the left(right) leg is shown in front of the player when sharing mount.
            ChairSittingFrame  = 14; //Animation when companion is sitting on a chair. Same frame because both frames are used.
            ReviveFrame        = 15; //Revive animation frame.
            DownedFrame        = 16; //Downed = Knocked Out
            BedSleepingFrame   = 17; //Sleeping animation for beds.
            ThroneSittingFrame = 18; //Animation when the companion is sitting on a throne.
            //DuckingFrame = 0; //Animation frame played when the companion is crouching.
            //DuckingSwingFrames = new int[] { 1, 2, 3}; //Attack animation frame for when the companion is ducking. 3 frames. Animation should be, Up, Up right, and Down right swing. On Up Right, set it somewhat above mouth, for when the companion uses potions.
            //PetrifiedFrame = 0; //Animation frame for when the companion is petrified. If there is no value set here, the game will freeze the animation, and apply some coloring to look like the follower is petrified.

            /*If you needed to move arrange the character sprite to fit the spritesheet, add the offset here.
             * For example, The bed is to the left of the spritesheet, based on the center of the sprite, add the number of pixels to the left
             * the bed is at.
             * Sprite is 64x64? Bed sprite is at 0. Set the SleepingOffset to 16, so It will discount 16 pixels from the animation.*/
            SleepingOffset = new Microsoft.Xna.Framework.Point(0, 0);

            SittingPoint = new Microsoft.Xna.Framework.Point(16 * 2, 27 * 2); //The position where the companion will sit on mount or chair. Take in consideration the center of It's legs.

            //Mounted position (aka mount sitting point).
            //If isn't a ReverseMount, will tell the position the player will sit on in each frame.
            //If is a ReverseMount, will tell the position the companion will sit on when mounting on the player.
            MountShoulderPoints.DefaultCoordinate2x = new Microsoft.Xna.Framework.Point(16, 27);

            //When set to true, tells the game that sprites drawn in front player on special occasions are on specified frames. This helps save memory.
            SpecificBodyFrontFramePositions = true;
            //Tells that Body Front frame 14 is 0.
            BodyFrontFrameSwap.Add(14, 0);

            //LeftHand is the same as the arm drawn in front of the body.
            //Since here, is to setup the center position of each hand. This is used for item positioning and other functions.
            //AddFramePoint2x automatically multiplicates the dimensions by 2, so you can speed up a bit this part.
            LeftHandPoints.AddFramePoint2x(10, 12, 15);
            LeftHandPoints.AddFramePoint2x(11, 20, 21);
            LeftHandPoints.AddFramePoint2x(12, 21, 24);
            LeftHandPoints.AddFramePoint2x(13, 18, 27);

            //I recommend setting points for the hands on the revive animation. It may be useful in the future.
            LeftHandPoints.AddFramePoint2x(15, 18, 28);

            //RightHand is the same as the arm drawn behind the body.
            RightHandPoints.AddFramePoint2x(10, 17, 15);
            RightHandPoints.AddFramePoint2x(11, 22, 21);
            RightHandPoints.AddFramePoint2x(12, 23, 24);
            RightHandPoints.AddFramePoint2x(13, 20, 27);

            RightHandPoints.AddFramePoint2x(13, 21, 28);

            /*Setups the position of the vanity items on the companion head. You will most likelly want to test this right after setting up, since the result may not be what you want.
             * At least until you find the exact point that makes hats looks okay on your companions.
             * Give your companion a Wizard Hat, It is perfect for testing this.*/
            HeadVanityPosition.DefaultCoordinate2x = new Microsoft.Xna.Framework.Point(16, 21);
            HeadVanityPosition.AddFramePoint2x(15, 18, 23);

            /*Sets the wing center position.
             * The mod automatically places It at the center of the companion sprite, but not always
             * It will be displayed correctly.
             */
            //WingPosition.DefaultCoordinate2x = new Microsoft.Xna.Framework.Point();
            WingPosition.AddFramePoint2x(15, 15, 25);

            //Links to companion specific rewards method.
            AddRewards();
            //Links to a method containing the topics you can have with this companion.
            GetTopics();
        }
示例#2
0
        /// <summary>
        /// -Very playful.
        /// -Blames himself for his old partner's demise.
        /// -Bad at protecting people.
        /// -Extremely sociable.
        /// </summary>

        public AlexBase()
        {
            Name = "Alex";
            Description = "Your new best friend - a very playful one.";
            Size = GuardianSize.Large;
            Width = 68;
            Height = 62;
            DuckingHeight = 52;
            SpriteWidth = 96;
            SpriteHeight = 96;
            Age = 42; //Age, 42. Mental Age, Real Age / 9
            SetBirthday(SEASON_WINTER, 19);
            Male = true;
            InitialMHP = 175; //1125
            LifeCrystalHPBonus = 30;
            LifeFruitHPBonus = 25;
            Accuracy = 0.36f;
            Mass = 0.7f;
            MaxSpeed = 5.65f;
            Acceleration = 0.33f;
            SlowDown = 0.83f;
            MaxJumpHeight = 15;
            JumpSpeed = 6.71f;
            CanDuck = false;
            ReverseMount = false;
            DrinksBeverage = false;
            DontUseRightHand = false;
            ForceWeaponUseOnMainHand = true;
            SetTerraGuardian();
            GroupID = GiantDogGuardianGroupID;
            //HurtSound = new SoundData(Terraria.ID.SoundID.DD2_KoboldHurt);
            //DeadSound = new SoundData(Terraria.ID.SoundID.DD2_KoboldDeath);
            CallUnlockLevel = 0;
            VladimirBase.AddCarryBlacklist(Alex);

            PopularityContestsWon = 0;
            ContestSecondPlace = 0;
            ContestThirdPlace = 4;

            AddInitialItem(Terraria.ID.ItemID.TungstenBroadsword, 1);
            AddInitialItem(Terraria.ID.ItemID.HealingPotion, 5);

            //Animation Frames
            StandingFrame = 0;
            WalkingFrames = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 };
            JumpFrame = 9;
            //HeavySwingFrames = new int[] { 10, 11, 12 };
            ItemUseFrames = new int[] { 10, 11, 12, 13 };
            //DuckingFrame = 20;
            //DuckingSwingFrames = new int[] { 21, 22, 12 };
            SittingFrame = 14;
            ChairSittingFrame = 31;
            SittingItemUseFrames = new int[] { 15, 16, 17 };
            DrawLeftArmInFrontOfHead.AddRange(new int[] { 10, 11, 15 });
            ThroneSittingFrame = 22;
            BedSleepingFrame = 23;
            SleepingOffset.X = 16;
            ReviveFrame = 20;
            DownedFrame = 29;
            PetrifiedFrame = 30;

            BackwardStanding = 32;
            BackwardRevive = 33;

            SpecificBodyFrontFramePositions = true;
            BodyFrontFrameSwap.Add(14, 0);

            //for(int f = 0; f < 9; f++)
            //    RightArmFrontFrameSwap.Add(f, 0);
            //RightArmFrontFrameSwap.Add(99, 1);
            //RightArmFrontFrameSwap.Add(100, 2);

            //Mount Player Sit Position
            MountShoulderPoints.DefaultCoordinate2x = new Point(30, 25);
            MountShoulderPoints.AddFramePoint2x(14, 13, 20);
            SittingPoint = new Point(20 * 2, 41 * 2); //14, 40 > 20,41

            //Left Arm Item Position
            LeftHandPoints.AddFramePoint2x(10, 37, 28);
            LeftHandPoints.AddFramePoint2x(11, 41, 31);
            LeftHandPoints.AddFramePoint2x(12, 42, 37);
            LeftHandPoints.AddFramePoint2x(13, 39, 43);

            LeftHandPoints.AddFramePoint2x(15, 24 + 6, 14 + 1);
            LeftHandPoints.AddFramePoint2x(16, 29 + 6, 27 + 1);
            LeftHandPoints.AddFramePoint2x(17, 22 + 6, 36 + 1);

            LeftHandPoints.AddFramePoint2x(19, 38, 47);
            LeftHandPoints.AddFramePoint2x(20, 38, 47);
            LeftHandPoints.AddFramePoint2x(21, 38, 47);
            LeftHandPoints.AddFramePoint2x(24, 38, 47);
            LeftHandPoints.AddFramePoint2x(25, 38, 47);
            LeftHandPoints.AddFramePoint2x(26, 38, 47);
            LeftHandPoints.AddFramePoint2x(27, 38, 47);
            LeftHandPoints.AddFramePoint2x(28, 38, 47);

            //Mouth Item Position
            RightHandPoints.DefaultCoordinate2x = new Point(43, 29);
            RightHandPoints.AddFramePoint2x(2, 31, 24);

            //Wing Position
            WingPosition.DefaultCoordinate2x = new Point(30, 27);
            WingPosition.AddFramePoint2x(14, 17 + 6, 25 + 1);
            WingPosition.AddFramePoint2x(18, 17 + 6, 25 + 1);

            //Helmet Position
            HeadVanityPosition.DefaultCoordinate2x = new Point(38, 23);
            HeadVanityPosition.AddFramePoint2x(14, 21 + 6, 17 + 1);
            HeadVanityPosition.AddFramePoint2x(15, 21 + 6, 17 + 1);
            HeadVanityPosition.AddFramePoint2x(16, 21 + 6, 17 + 1);
            HeadVanityPosition.AddFramePoint2x(17, 21 + 6, 17 + 1);
            HeadVanityPosition.AddFramePoint2x(18, 21 + 6, 17 + 1);
            HeadVanityPosition.AddFramePoint2x(22, 23, 17);

            HeadVanityPosition.AddFramePoint2x(19, -1000, -1000);
            HeadVanityPosition.AddFramePoint2x(20, -1000, -1000);
            HeadVanityPosition.AddFramePoint2x(21, -1000, -1000);
            HeadVanityPosition.AddFramePoint2x(19, -1000, -1000);
            HeadVanityPosition.AddFramePoint2x(24, -1000, -1000);
            HeadVanityPosition.AddFramePoint2x(25, -1000, -1000);
            HeadVanityPosition.AddFramePoint2x(26, -1000, -1000);
            HeadVanityPosition.AddFramePoint2x(27, -1000, -1000);
            HeadVanityPosition.AddFramePoint2x(28, -1000, -1000);

            AddSkinsAndOutfits();
        }