204 lines
12 KiB
C#
204 lines
12 KiB
C#
|
||
using UnityEngine;
|
||
using System.Collections.Generic;
|
||
|
||
namespace BF
|
||
{
|
||
// MonsterData的monsterType,0,1,2分别对应小怪,精英和boss,这里就加一个4:英雄
|
||
public static class BattleUnitType
|
||
{
|
||
// 小怪
|
||
public const int NORMAL = 0;
|
||
// 精英
|
||
public const int ELITE = 1;
|
||
// BOSS
|
||
public const int BOSS = 2;
|
||
// 英雄
|
||
public const int HERO = 4;
|
||
}
|
||
|
||
public static class BattleConst
|
||
{
|
||
public const int SIDE_ATK = 1;
|
||
public const int SIDE_DEF = 2;
|
||
public const int DOTWEEN_ID_BATTLE = 2;
|
||
public const string BATTLE_POOL_NAME = "battle_pool";
|
||
public const string BATTLE_ROOT_NAME = "battle_root";
|
||
public const string BATTLE_BOX_COLLIDER_NAME = "box_collider";
|
||
public const string BATTLE_SPHERE_COLLIDER_NAME = "sphere_collider";
|
||
public const string BATTLE_SPHERE_BULLET_NAME = "sphere_bullet";
|
||
public const string BATTLE_BOX_BULLET_NAME = "box_bullet";
|
||
public const string BATTLE_AIM_NAME = "aim";
|
||
public static int LAYER_DEFAULT = LayerMask.NameToLayer("Default");
|
||
public static int LAYER_HERO = LayerMask.NameToLayer("Hero");
|
||
public static int LAYER_MONSTER = LayerMask.NameToLayer("Monster");
|
||
public static int LAYER_ATK_BULLET = LayerMask.NameToLayer("AtkBullet");
|
||
public static int LAYER_DEF_BULLET = LayerMask.NameToLayer("DefBullet");
|
||
public const int DEFAULT_FACTOR = 10000;
|
||
public const float DEFAULT_FACTOR_FLOAT = 10000.0f;
|
||
public const double DEFAULT_FACTOR_DOUBLE = 10000.0;
|
||
// 360°对应的弧度值
|
||
public const float CircleRadians = 360.0f*Mathf.Deg2Rad;
|
||
public const float NegativeCircleRadians = -360.0f*Mathf.Deg2Rad;
|
||
public static MaterialPropertyBlock UnitMaterialPropertyBlock = new MaterialPropertyBlock();
|
||
public static int UNIT_GLOW_COLOR_ID = Shader.PropertyToID("_glow_color");
|
||
public static int UNIT_GLOW_COLOR_ENABLE_ID = Shader.PropertyToID("_glow_color_enable");
|
||
public const float DelayRecycle = 0.35f;
|
||
public const float DeadMoveSpeed = 5.0f;
|
||
public const float DeadMoveDistance = 3.0f;
|
||
public const string SPRITE_CHARACTER_SHADER_NAME = "BF/Sprites/Character";
|
||
public const string MODEL_CHARACTER_SHADER_NAME = "BF/Models/Character";
|
||
public const float UNIT_MOVE_DISTANCE = 1000.0f;
|
||
public const float UNIT_MOVE_DISTANCE_OPPOSITE = -1000.0f;
|
||
public const float ITEM_QUICK_MOVE_SPEED = 10.0f;
|
||
public const float ITEM_QUICK_MOVE_TIME = 2.0f;
|
||
public const float EXP_ITEM_MOVE_SPEED = 10.0f;
|
||
public const float EXP_ITEM_MOVE_TIME = 0.2f;
|
||
public const float CHECK_DIRECTION_TIME = 0.1f;
|
||
public const float RADIANS_10 = 10.0f*Mathf.Deg2Rad;
|
||
public const float RADIANS_180 = 180.0f*Mathf.Deg2Rad;
|
||
public const float RADIANS_NEGATIVE_180 = -180.0f*Mathf.Deg2Rad;
|
||
public const float RADIANS_360 = 360.0f*Mathf.Deg2Rad;
|
||
public const int EFFECT_TYPE_MOVE_L = 1;
|
||
public const int EFFECT_TYPE_MOVE_R = 2;
|
||
public const int EFFECT_TYPE_MOVE_L_2 = 3;
|
||
public const int EFFECT_TYPE_MOVE_R_2 = 4;
|
||
public const int EFFECT_TYPE_CRIT = 5;
|
||
public const int EFFECT_TYPE_BUFF = 6;
|
||
public static Color COLOR_ICE = new Color(0.647f, 0.752f, 0.933f);
|
||
public static Color COLOR_STAGNATE = new Color(0.7f, 0.7f, 0.1f);
|
||
public static Color COLOR_FEAR = new Color(0.1359f, 0.4222f, 0.6132f, 0.0f);
|
||
// 无限地图类型
|
||
public static int MAP_TYPE_UNLIMITED = 1;
|
||
// 竖向无限地图类型
|
||
public static int MAP_TYPE_PORTRAIT = 2;
|
||
// 方块地图类型
|
||
public static int MAP_TYPE_SQUARE = 3;
|
||
// 竖向无限地图类型2,比1小一点
|
||
public static int MAP_TYPE_SMALL_PORTRAIT = 4;
|
||
// 方块地图类型2,比1要小一些
|
||
public static int MAP_TYPE_SMALL_SQUARE = 5;
|
||
public static int ANIMATION_NAME_HASH_RUN = UnityEngine.Animator.StringToHash("run");
|
||
public static int ANIMATION_NAME_HASH_CHARGE = UnityEngine.Animator.StringToHash("charge");
|
||
public static int ANIMATION_NAME_HASH_CHARGE_LOOP = UnityEngine.Animator.StringToHash("charge_loop");
|
||
public const string SFX_DJGX_01 = "assets/prefabs/effects/battle/sfx_djgx_01.prefab";
|
||
public const string SFX_BXGZ_01 = "assets/prefabs/effects/battle/sfx_bxgz_01.prefab";
|
||
// CS.UnityEngine.Animator.StringToHash("battle_number_move_l")结果是-526518883
|
||
public const int ANIMATOR_HASH_NAME_NUMBER_MOVE_L = -526518883;
|
||
// CS.UnityEngine.Animator.StringToHash("battle_number_move_r")结果是445827326
|
||
public const int ANIMATOR_HASH_NAME_NUMBER_MOVE_R = 445827326;
|
||
// CS.UnityEngine.Animator.StringToHash("battle_number_buff")结果是1364146828
|
||
public const int ANIMATOR_HASH_NAME_NUMBER_BUFF = 1364146828;
|
||
// CS.UnityEngine.Animator.StringToHash("battle_number_crit")结果是-1734531349
|
||
public const int ANIMATOR_HASH_NAME_NUMBER_CRIT = -1734531349;
|
||
// CS.UnityEngine.Animator.StringToHash("battle_number_move_2_l")结果是1474588660
|
||
public const int ANIMATOR_HASH_NAME_NUMBER_MOVE_L_2 = 1474588660;
|
||
// CS.UnityEngine.Animator.StringToHash("battle_number_move_2_r")结果是-1377086825
|
||
public const int ANIMATOR_HASH_NAME_NUMBER_MOVE_R_2 = -1377086825;
|
||
public const int ANIMATOR_HAS_NAME_SKILL_TOAST = -253867994;
|
||
public const RigidbodyConstraints RIGIDBODY_CONSTRAINTS = RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezeRotation;
|
||
}
|
||
|
||
public static class BattlePosition
|
||
{
|
||
// 预处理
|
||
// 9 2 3
|
||
// 8 1 4
|
||
// 7 6 5
|
||
public static int[] RectPositionX = new int[121] {
|
||
0, 0, 1, 1, 1, 0, -1, -1, -1,
|
||
-1, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2,
|
||
-2, -1, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, -1, -2, -3, -3, -3, -3, -3, -3, -3,
|
||
-3, -2, -1, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 1, 0, -1, -2, -3, -4, -4, -4, -4, -4, -4, -4, -4, -4,
|
||
-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5
|
||
};
|
||
|
||
public static int[] RectPositionZ = new int[121] {
|
||
0, 1, 1, 0, -1, -1, -1, 0, 1,
|
||
2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2, -1, 0, 1, 2,
|
||
3, 3, 3, 3, 3, 3, 2, 1, 0, -1, -2, -3, -3, -3, -3, -3, -3, -3, -2, -1, 0, 1, 2, 3,
|
||
4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 1, 0, -1, -2, -3, -4, -4, -4, -4, -4, -4, -4, -4, -4, -3, -2, -1, 0, 1, 2, 3, 4,
|
||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5
|
||
};
|
||
}
|
||
|
||
public static class BattleTMPNumber
|
||
{
|
||
public const float PUT_BACK_TIME = 1.367f;
|
||
//dmg number
|
||
public static readonly Dictionary<int, char[]> dmgNumber2StrDic = new Dictionary<int, char[]>()
|
||
{
|
||
{0 , new char[]{'<','s','p','r','i','t','e','=','1','6','>'}},
|
||
{1 , new char[]{'<','s','p','r','i','t','e','=','1','7','>'}},
|
||
{2 , new char[]{'<','s','p','r', 'i','t','e','=','1','8','>'}},
|
||
{3 , new char[]{'<','s','p','r', 'i','t','e','=','1','9','>'}},
|
||
{4 , new char[]{'<','s','p','r', 'i','t','e','=','2','0','>'}},
|
||
{5 , new char[]{'<','s','p','r', 'i','t','e','=','2','1','>'}},
|
||
{6 , new char[]{'<','s','p', 'r', 'i','t','e','=','2','2','>'}},
|
||
{7 , new char[]{'<','s','p', 'r', 'i','t','e','=','2','3','>'}},
|
||
{8 , new char[]{'<','s','p', 'r', 'i','t','e','=','2','4','>'}},
|
||
{9 , new char[]{'<','s','p','r', 'i','t','e','=','2','5','>'}},
|
||
};
|
||
public static readonly char[] dmgAdd = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '2', '7', '>' };
|
||
public static readonly char[] dmgSub = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '1', '4', '>' };
|
||
// public static readonly char[] dmgK = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '2', '6', '>' };
|
||
// public static readonly char[] dmgM = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '1', '5', '>' };
|
||
|
||
//crit number
|
||
public static readonly Dictionary<int, char[]> critNumber2StrDic = new Dictionary<int, char[]>()
|
||
{
|
||
{0 , new char[]{'<','s','p', 'r', 'i','t','e','=','7','>'}},
|
||
{1 , new char[]{'<','s','p', 'r', 'i','t','e','=','2','>'}},
|
||
{2 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','>'}},
|
||
{3 , new char[]{'<','s','p', 'r', 'i','t','e','=','8','>'}},
|
||
{4 , new char[]{'<','s','p', 'r', 'i','t','e','=','4','>'}},
|
||
{5 , new char[]{'<','s','p', 'r', 'i','t','e','=','9','>'}},
|
||
{6 , new char[]{'<','s','p', 'r', 'i','t','e','=','1','0','>'}},
|
||
{7 , new char[]{'<','s','p', 'r', 'i','t','e','=','5','>'}},
|
||
{8 , new char[]{'<','s','p', 'r', 'i','t','e','=','1','1','>'}},
|
||
{9 , new char[]{'<','s','p', 'r', 'i','t','e','=','1','2','>'}},
|
||
};
|
||
public static readonly char[] critFlag = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '1', '3', '>' };
|
||
public static readonly char[] critAdd = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '1', '>' };
|
||
public static readonly char[] critSub = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '0', '>' };
|
||
// public static readonly char[] critK = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '6', '>' };
|
||
// public static readonly char[] critM = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '2', '8', '>' };
|
||
|
||
//heal number
|
||
public static readonly Dictionary<int, char[]> healNumber2StrDic = new Dictionary<int, char[]>()
|
||
{
|
||
{0 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','1','>'}},
|
||
{1 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','2','>'}},
|
||
{2 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','3','>'}},
|
||
{3 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','4','>'}},
|
||
{4 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','5','>'}},
|
||
{5 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','6','>'}},
|
||
{6 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','7','>'}},
|
||
{7 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','8','>'}},
|
||
{8 , new char[]{'<','s','p', 'r', 'i','t','e','=','3','9','>'}},
|
||
{9 , new char[]{'<','s','p', 'r', 'i','t','e','=','4','0','>'}},
|
||
};
|
||
public static readonly char[] healAdd = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '4', '3', '>' };
|
||
public static readonly char[] healSub = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '4', '2', '>' };
|
||
// public static readonly char[] healK = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '4', '1', '>' };
|
||
// public static readonly char[] healM = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '4', '1', '>' };
|
||
|
||
//red number
|
||
public static readonly Dictionary<int, char[]> redNumber2StrDic = new Dictionary<int, char[]>()
|
||
{
|
||
{0 , new char[]{'<','s','p', 'r', 'i','t','e','=','5','6','>'}},
|
||
{1 , new char[]{'<','s','p', 'r', 'i','t','e','=','4','5','>'}},
|
||
{2 , new char[]{'<','s','p', 'r', 'i','t','e','=','4','6','>'}},
|
||
{3 , new char[]{'<','s','p', 'r', 'i','t','e','=','4','7','>'}},
|
||
{4 , new char[]{'<','s','p', 'r', 'i','t','e','=','4','8','>'}},
|
||
{5 , new char[]{'<','s','p', 'r', 'i','t','e','=','5','1','>'}},
|
||
{6 , new char[]{'<','s','p', 'r', 'i','t','e','=','5','2','>'}},
|
||
{7 , new char[]{'<','s','p', 'r', 'i','t','e','=','4','9','>'}},
|
||
{8 , new char[]{'<','s','p', 'r', 'i','t','e','=','5','3','>'}},
|
||
{9 , new char[]{'<','s','p', 'r', 'i','t','e','=','5','4','>'}},
|
||
};
|
||
public static readonly char[] redAdd = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '2', '9', '>' };
|
||
public static readonly char[] redSub = new char[] { '<', 's', 'p', 'r', 'i', 't', 'e', '=', '5', '5', '>' };
|
||
}
|
||
}
|