コード例 #1
0
        protected virtual Texture2D background(Game_Unit battler)
        {
            const string background_format = @"Graphics/Battlebacks/{0}-BG";

            // Checks if the map has a forced background for this tile
            string terrain_name = Global.game_map.forced_battleback(battler.loc);

            if (!string.IsNullOrEmpty(terrain_name))
            {
                if (Global.content_exists(string.Format(background_format, terrain_name)))
                {
                    return(battle_content.Load <Texture2D>(string.Format(background_format, terrain_name)));
                }
            }

            // Else loads based on terrain type
            int       tag = battler.terrain_id();
            Texture2D result;

            // Check for background
            terrain_name = Global.data_terrains[tag].BackgroundName;
            result       = terrain_texture(background_format, terrain_name);
            if (result != null)
            {
                return(result);
            }

            return(battle_content.Load <Texture2D>(string.Format(background_format, "Plains")));
        }
コード例 #2
0
        protected void create_platforms()
        {
            bool right_battler_is_battler_1 = Reverse;

            Platform = new Battle_Platform(Distance > 1);

            var battler1 = Battler_1;
            var battler2 = Battler_2;

            // Skills: Swoop
            if (battler2 != null && battler1.swoop_activated)
            {
                // Use the opponent's platform for swooping attackers
                battler1 = battler2;
            }

            Game_Unit right_battler = battler1, left_battler = battler1;

            if (battler2 != null)
            {
                right_battler = Reverse ? battler1 : battler2;
                left_battler  = !Reverse ? battler1 : battler2;
            }

            int rightPlatformTerrain = right_battler.terrain_id();

            Platform.platform_2 = platform(rightPlatformTerrain, Distance);
            Platform.loc_2      = (right_battler_is_battler_1 ? Battler_1_Loc : Battler_2_Loc) + new Vector2(Distance == 1 ? -24 : -37, 94);

            int leftPlatformTerrain = left_battler.terrain_id();

            Platform.platform_1 = platform(leftPlatformTerrain, Distance);
            Platform.loc_1      = Platform.loc_2 + new Vector2(Distance == 1 ? -87 : -(154 + (Distance == 2 ? 0 : 270)), 0);
        }