Example #1
0
    public void InitPlayer(LevelScriptBase script)
    {
        Team     = 1;
        IsPlayer = true;
        Speed    = 1000;
        if (script == null)
        {
            name       = "孟星魂";
            SpawnPoint = 0;
            SpawnDir   = 0;

            Weapon  = 51;
            Weapon2 = 47;
            HpMax   = hpCur = 1000;
        }
        else
        {
            name       = script.GetPlayerName();
            Model      = script.GetPlayerModel();
            SpawnPoint = script.GetPlayerSpawn();
            SpawnDir   = script.GetPlayerSpawnDir();//一个Z轴朝内,一个Z轴朝外,角度自己来换吧。
            Weapon     = (int)(double)script.GetPlayerWeapon();
            Weapon2    = (int)(double)script.GetPlayerWeapon2();
            HpMax      = hpCur = (int)(double)script.GetPlayerMaxHp();
            if (HpMax == 0)
            {
                hpCur = HpMax = 1000;
            }
        }
        View       = 50;
        AngryValue = 0;
        IsDead     = false;
    }
Example #2
0
    public void InitPlayer(LevelScriptBase script)
    {
        Team     = 1;
        IsPlayer = true;
        Speed    = 1000;
        if (script == null)
        {
            name       = StringUtils.DefaultPlayer;
            SpawnPoint = 0;
            SpawnDir   = 0;

            Weapon  = 51;
            Weapon2 = 47;
            HpMax   = hpCur = 10000;
        }
        else
        {
            name       = script.GetPlayerName();
            Model      = script.GetPlayerModel();
            SpawnPoint = script.GetPlayerSpawn();
            SpawnDir   = script.GetPlayerSpawnDir();//一个Z轴朝内,一个Z轴朝外,角度自己来换吧。
            Weapon     = (int)(double)script.GetPlayerWeapon();
            Weapon2    = (int)(double)script.GetPlayerWeapon2();
            HpMax      = hpCur = (int)(double)script.GetPlayerMaxHp();
            if (HpMax == 0)
            {
                hpCur = HpMax = 1000;
            }
            if (CombatData.Ins.GLevelMode == LevelMode.CreateWorld)
            {
                HpMax   = hpCur = 10 * CombatData.Ins.PlayerLife;
                Weapon  = U3D.GetWeaponByType(CombatData.Ins.MainWeapon);
                Weapon2 = U3D.GetWeaponByType(CombatData.Ins.SubWeapon);
                Model   = CombatData.Ins.PlayerModel;
                name    = DataMgr.Ins.GetModelDatas()[Model].Name;
            }
        }
        View       = 500;
        AngryValue = 0;
        IsDead     = false;
    }