/// <summary>
    /// ウィンドウにGUIを配置
    /// </summary>
    /// <param name="id"></param>
    private void GUI(int id)
    {
        //ボタンが押されたらプレイヤーの設定を開く
        if (GUILayout.Button("プレイヤーの設定を開く"))
        {
            player_param = new PlayerParameter();
            SceneView.onSceneGUIDelegate -= MenuOnSceneGUI;
        }
        EditorGUILayout.Space();

        //ボタンが押されたらボスの設定を開く
        if (GUILayout.Button("ボスの設定を開く"))
        {
            boss_param = new BossParameter();
            SceneView.onSceneGUIDelegate -= MenuOnSceneGUI;
        }
        EditorGUILayout.Space();

        //ステージファイル読み込み
        GUILayout.BeginHorizontal();
        GUILayout.Label("ステージファイル : ");
        stageFile = EditorGUILayout.ObjectField(stageFile, typeof(object), true);
        GUILayout.EndHorizontal();

        //ボタンが押されたらステージの大きさ変更
        GUILayout.BeginHorizontal();
        for (int i = 0; i < stages.Count; i++)
        {
            if (GUILayout.Button("ステージ" + i))
            {
            }
            EditorGUILayout.Space();
        }
        GUILayout.EndHorizontal();
    }
Beispiel #2
0
 void Start()
 {
     parameter   = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <PlayerParameter>();
     m_Transform = transform;
     //相対位置を初期化(誤操作防止)
     m_Transform.localPosition = positionOffset;
 }
Beispiel #3
0
    public void ClickClearButton()
    {
        PlayerParameter player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerParameter>();

        QuestData RemoveData = SlotList[slotID].GetComponent <QuestSlot>().data;

        player.Money       += RemoveData.Reward.Coin;
        player.Current_Exp += RemoveData.Reward.Exp;

        if (RemoveData.quest.type == TYPE.Collect)
        {
            RemoveQuestItem(RemoveData);
        }

        if (RemoveData.Reward.item != null)
        {
            Inventory inven = GameObject.FindGameObjectWithTag("Inventory").GetComponent <Inventory>();

            for (int i = 0; i < RemoveData.Reward.itemNum; i++)
            {
                inven.AddItem(RemoveData.Reward.item.GetComponent <Item>());
            }
        }

        UIManager.Getinstance().UpdatePlayerUI(player);

        Destroy(SlotList[slotID].gameObject);
        SlotList.Remove(slotID);

        QuestManager.Getinstace().AcceptedquestList.Remove(RemoveData);
        QuestManager.Getinstace().questList.Remove(RemoveData);
        QuestInfo.SetActive(false);
    }
        public async Task <PagingResponse <PlayerDto> > GetPlayers(PlayerParameter playerParameters)
        {
            var queryStringParam = new Dictionary <string, string>
            {
                ["pageNumber"] = playerParameters.PageNumber.ToString()
            };

            var response = await _client.GetAsync(QueryHelpers.AddQueryString("/api/player", queryStringParam));

            var content = await response.Content.ReadAsStringAsync();

            if (!response.IsSuccessStatusCode)
            {
                throw new ApplicationException(content);
            }

            var pagingResponse = new PagingResponse <PlayerDto>
            {
                Items = JsonSerializer.Deserialize <List <PlayerDto> >(content, new JsonSerializerOptions {
                    PropertyNameCaseInsensitive = true
                }),
                MetaData = JsonSerializer.Deserialize <PagedMetaData>(response.Headers.GetValues("X-Pagination").First(), new JsonSerializerOptions {
                    PropertyNameCaseInsensitive = true
                })
            };

            return(pagingResponse);
        }
 public void paramUpdate(PlayerParameter param)
 {
     setLevel(param.CurrentLevel);
     setHP((int)param.CurrentHP, param.MaxHP);
     setHunger(param.CurrentHunger,param.MaxHunger);
     setWallet(param.Inventory.Wallet);
 }
 static PlayerParameterManager()
 {
     Empty = new PlayerParameter()
     {
         CanvasName = string.Empty, CanvasID = string.Empty
     };
 }
 public static bool IsNullOrDefault(PlayerParameter currentPlayer)
 {
     if (currentPlayer == null)
     {
         return(true);
     }
     return(currentPlayer.CanvasID == Empty.CanvasID);
 }
Beispiel #8
0
 public void UpdatePlayerUI(PlayerParameter p_Parameter)
 {
     PlayerName.text  = "Name : " + p_Parameter.name;
     PlayerCoin.text  = "Coin : " + p_Parameter.Money;
     PlayerLevel.text = "Level : " + p_Parameter.level;
     PlayerHP.rectTransform.localScale  = new Vector3((float)p_Parameter.Current_HP / (float)p_Parameter.Max_HP, 1f, 1f);
     PlayerExp.rectTransform.localScale = new Vector3((float)p_Parameter.Current_Exp / (float)p_Parameter.ExpToNextLevel, 1f, 1f);
 }
 public JumpCommand(ICharacterComponent character)
     : base(character)
 {
     playerMove      = character.CharacterTransform.GetComponent <PlayerMove>();
     playerParameter = character.CharacterTransform.GetComponent <PlayerParameter>();
     playerInput     = character.CharacterTransform.GetComponent <PlayerInput>();
     smokeParticle   = character.CharacterTransform.GetComponentInChildren <ParticleSystem>();
 }
 void Awake()
 {
     parameter = PlayerInfoCounter.Instance.GetParameter;
     for (int i = 0; i < _lifeUI.Length; i++)
     {
         _lifeUI[i] = transform.GetChild(i).gameObject.GetComponent <Image>();
     }
 }
Beispiel #11
0
 public PagedList <Player> GetPlayers(PlayerParameter parameter)
 {
     return(FindByCondition(player => player.DateCreated.Date >= parameter.MinDateCreated.Date &&
                            player.DateCreated.Date <= parameter.MaxDateCreated.Date)
            .SearchByAccount(parameter.Account)
            .OrderByQuery(parameter.OrderBy)
            .ToPagedList(parameter.PageNumber, parameter.PageSize));
 }
Beispiel #12
0
    void Start()
    {
        rectTrans = GetComponent<RectTransform>();
        startPos = rectTrans.anchoredPosition;

         playerParameter = GetComponent<PlayerParameter>();
           // _jumpPower = playerParameter.getJumpPower;
    }
Beispiel #13
0
 public PlayerScore(PlayerParameter param, DungeonInformation dginfo, CauseOfDeathBasis cod)
 {
     PlayerParameter = param;
     DgInfo = dginfo;
     TotalScore = calcScore();
     EquipingNames = getEquiping();
     TotalTurn = dginfo.CurrentTotalTurnCount;
     COD = cod;
 }
Beispiel #14
0
    private void Start()
    {
        m_Ani = GetComponent <PlayerAni>();
        ChangeState(State.Idle, PlayerAni.Ani_Idle);

        p_Parameter = GetComponent <PlayerParameter>();
        p_Parameter.InitParameter();
        p_Parameter.DeadEvent.AddListener(ChangeToPlayerDead);
    }
Beispiel #15
0
    private void Awake()
    {
        isSlot = false;

        float size = text.gameObject.transform.parent.GetComponent <RectTransform>().sizeDelta.x;

        text.fontSize = (int)(size * 0.3f);

        playerParameter = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerParameter>();
    }
Beispiel #16
0
 //パラメータを作成
 public static PlayerParameter getPlayerParameter(string cName, int maxHp, int atk)
 {
     var parameter = new PlayerParameter();
     parameter.cName = cName;
     parameter.lv = 1;
     parameter.maxHp = maxHp;
     parameter.atk = atk;
     parameter.hp = parameter.maxHp;
     parameter.maxSp = 100;
     parameter.sp = parameter.maxSp;
     return parameter;
 }
Beispiel #17
0
    // Use this for initialization
    void Start()
    {
        Bigtex        = Big.GetComponent <Text>();
        Bigtex.text   = "x 0";
        Smalltex      = Small.GetComponent <Text>();
        Smalltex.text = "x 0";

        Player      = GameObject.FindGameObjectWithTag("Player");
        pp          = Player.GetComponent <PlayerParameter>();
        BigvalBuf   = pp.Bheal;
        SmallvalBuf = pp.Sheal;
    }
Beispiel #18
0
 public PlayerController(PlayerParameter playerParameter, GameObject speedEffectObj = null)
 {
     parameter      = playerParameter;
     playerMover    = new PlayerMover(parameter.StartAccelSpeed);
     playerInput    = new PlayerInput();
     playerGravity  = new PlayerGravity();
     playerAnimator = new PlayerAnimator();
     gameObject     = PlayerObjectManager.Instance.PlayerObject;
     if (speedEffectObj != null)
     {
         speedEffectObject = speedEffectObj;
     }
 }
Beispiel #19
0
    private AKGun gun;                      //akgunスクリプト

    void Start()
    {
        //初期化
        parameter            = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <PlayerParameter>();
        playerControl        = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <PlayerController>();
        gun                  = GameObject.FindGameObjectWithTag(Tags.gun).GetComponent <AKGun>();
        anim                 = this.GetComponent <Animation>();
        flash                = this.transform.Find("muzzle_flash").GetComponent <MeshRenderer>();
        flash.enabled        = false;
        currentBullet        = gun.bulletCount;
        currentChargerBullet = gun.chargerBulletCount;
        bulletText.text      = "弾" + currentBullet + "/" + currentChargerBullet;
    }
    public override void OnCreate()
    {
        base.OnCreate();
        playerParameter = GetComponent <PlayerParameter>();
        blinkingTimer   = new Timer(0.1f);
        invincibleTimer = new Timer(playerParameter.parameter.invincibleTime);

        Score    = 0;
        HP       = playerParameter.parameter.hp;
        IsHit    = false;
        IsCreate = true;
        animator = GetComponent <Animator>();
        animator.applyRootMotion = true;
    }
Beispiel #21
0
 // Start is called before the first frame update
 void Start()
 {
     crouching              = false;
     walking                = false;
     running                = false;
     speed                  = normalSpeed;
     jumpSpeed              = normalJumpSpeed;
     mainCamera             = GameObject.FindGameObjectWithTag(Tags.mainCamera).transform;
     standardCamHeight      = mainCamera.localPosition.y;
     crouchingCamHeight     = standardCamHeight - crouchDeltaHeight;
     audioSource            = this.GetComponent <AudioSource>();
     controller             = this.GetComponent <CharacterController>();
     parameter              = this.GetComponent <PlayerParameter>();
     normalControllerCenter = controller.center;
     normalControllerHeight = controller.height;
 }
Beispiel #22
0
    private Vector3 moveDirection          = Vector3.zero; //ユーザの移動方向の初期化


    void Start()
    {
        //初期化
        walking                = false;
        crouching              = false;
        crouching              = false;
        speed                  = walkSpeed;
        jumpSpeed              = walkJumpSpeed;
        mainCamera             = GameObject.FindGameObjectWithTag(Tags.mainCamera).transform;
        parameter              = this.GetComponent <PlayerParameter>();
        audioSource            = this.GetComponent <AudioSource>();
        c_Controller           = this.GetComponent <CharacterController>();
        standardCameraHeight   = mainCamera.localPosition.y;
        crouchingCameraHeight  = standardCameraHeight - crouchDetalHeight;
        normalControllerHeight = c_Controller.height;
        normalControllerCenter = c_Controller.center;
    }
Beispiel #23
0
    private void Start()
    {
        e_Ani = GetComponent <EnemyAni>();
        ChangeState(M_State.Idle, EnemyAni.Idle);

        player = GameObject.FindGameObjectWithTag("Player").transform;

        e_Parameter = GetComponent <EnemyParameter>();
        e_Parameter.DeadEvent.AddListener(CallDeadEvent);
        p_Parameter = player.gameObject.GetComponent <PlayerParameter>();

        GetComponent <ObjectData>().Obj_ID = e_Parameter.Monster_ID;

        controller = GetComponent <CharacterController>();

        HideSelection();
    }
    // Use this for initialization
    void Start()
    {
        animator     = GetComponent <Animator>();
        dmg          = GetComponent <Damage>();
        PlayerSprite = GetComponent <SpriteRenderer>();
        cam          = Camera.main.gameObject;
        //st = cam.GetComponent<samplestruct>();
        switch (SceneManager.GetActiveScene().name)
        {
        case "Tutorial Full":
            scene = 1;
            GameObject item0 = GameObject.Find("Items_Tutorial");
            st = item0.GetComponent <samplestruct>();
            break;

        case "Normal Full":
            scene = 2;
            Debug.Log("Normal Full");
            GameObject item1 = GameObject.Find("Items_Normal");
            ns = item1.GetComponent <NormalStruct>();
            break;

        case "Hard Full":
            scene = 3;
            GameObject item2 = GameObject.Find("Items_Hard");
            hs = item2.GetComponent <HardStruct>();
            sw = GameObject.Find("Room 2").GetComponent <StageWall>();
            ss = GameObject.Find("Switch").GetComponent <StageSwitch>();
            break;
        }

        /*
         * GameObject item = GameObject.Find("Items");
         * st = item.GetComponent<samplestruct>();
         */
        pp = GetComponent <PlayerParameter>();
        GameObject canvas = GameObject.Find("Canvas");

        mw = canvas.GetComponent <MessageWindow>();


        //Debug.Log(st.Items);
    }
Beispiel #25
0
        /// <summary>
        /// 保存ボタンクリックイベント。
        /// </summary>
        /// <param name="sender">イベント発行元</param>
        /// <param name="e">イベントパラメータ</param>
        private async void BtnSave_Click(object sender, EventArgs e)
        {
            // 保存ダイアログ表示
            var dialog = new SaveFileDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var filePath = dialog.FileName;

                var player = new PlayerParameter()
                {
                    Name   = this.txtName.Text,
                    IsMale = this.rbtnMale.Checked,
                    IsAvailableOnFirstPlay = this.chkIsAvailableOnFirstPlay.Checked,
                    ParameterType          = (PlayerParameter.PlayerParameterType) this.cmbParameterType.SelectedValue,

                    // 職業のGroupBoxの中に配置されているRadioButtonの中で選択状態のもののTagを取得
                    Job = (JobType)this.grbJob.Controls.OfType <RadioButton>().First(x => x.Checked).Tag
                };

                await this.service.SaveAsync(player, filePath);
            }
        }
        public IActionResult GetPlayers([FromQuery] PlayerParameter parameter)
        {
            try
            {
                if (!parameter.ValidDateCreatedRange)
                {
                    return(BadRequest("结束日期需要小于开始日期不"));
                }

                var players = _repository.Player.GetPlayers(parameter);

                Response.Headers.Add("X-Pagination", JsonConvert.SerializeObject(players.MetaData));

                var result = _mapper.Map <IEnumerable <PlayerDto> >(players)
                             .ShapeData(parameter.Fields);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return(StatusCode(500));
            }
        }
Beispiel #27
0
 // Start is called before the first frame update
 void Start()
 {
     LockCursor = true;
     parameter  = this.GetComponent <PlayerParameter>();
     input      = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <GameInput>();
 }
    public void initializeData()
    {
        if (playerParameter == null){
            playerParameter = NetworkManagerCustom.SingletonNM.playerData.GetComponent<PlayerParameter>();
        }

        playerParameter = playerParameter.getPlayer(role, rank);
        //Debug.Log("playerParameter " + playerParameter.maxHp);
        GetComponent<PlayerInfo>().max_health = playerParameter.maxHp;
        GetComponent<PlayerInfo>().setHealth(playerParameter.maxHp);

        GetComponent<StrikerSkill1>().coolDown = playerParameter.coolingDown_1;
        GetComponent<StrikerSkill1>().damage =  playerParameter.attackPt;
        GetComponent<StrikerSkill2>().coolDown = playerParameter.coolingDown_2;
        GetComponent<StrikerSkill2>().damage = role == PlayerRole.Striker ? playerParameter.ultiPt : playerParameter.ultiTime;
        if (role == PlayerRole.Defender)
        {
            shieldTime = playerParameter.sheildTime;
            shieldNumber = playerParameter.sheildHp;
        }
    }
 public void init(PlayerParameter param, DungeonInformation dginfo)
 {
     paramUpdate(param);
     infoUpdate(dginfo);
 }
Beispiel #30
0
 void Awake()
 {
     Instance = this;
 }
Beispiel #31
0
 // Use this for initialization
 void Start()
 {
     sources = gameObject.GetComponents <AudioSource>();
     pp      = GetComponent <PlayerParameter>();
 }
Beispiel #32
0
 private void Start()
 {
     player    = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerParameter>();
     inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent <Inventory>();
 }
Beispiel #33
0
 void Start()
 {
     parameter   = this.GetComponent <PlayerParameter>();
     playerItems = this.GetComponent <PlayerItems>();
 }
 private static void InitStatus()
 {
     Param = new PlayerParameter ();
 }
Beispiel #35
0
    private void Start()
    {
        p_parameter = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerParameter>();

        Window.SetActive(isActive);
    }
Beispiel #36
0
        public static int SplitFile(string datafilename, string inifilename, string projectFolderName, bool nometa = false, bool nolabel = false)
        {
#if !DEBUG
            try
#endif
            {
                byte[]  datafile;
                byte[]  datafile_temp           = File.ReadAllBytes(datafilename);
                IniData inifile                 = IniSerializer.Deserialize <IniData>(inifilename);
                string  listfile                = Path.Combine(Path.GetDirectoryName(inifilename), Path.GetFileNameWithoutExtension(datafilename) + "_labels.txt");
                Dictionary <int, string> labels = new Dictionary <int, string>();
                if (File.Exists(listfile) && !nolabel)
                {
                    labels = IniSerializer.Deserialize <Dictionary <int, string> >(listfile);
                }
                if (inifile.StartOffset != 0)
                {
                    byte[] datafile_new = new byte[inifile.StartOffset + datafile_temp.Length];
                    datafile_temp.CopyTo(datafile_new, inifile.StartOffset);
                    datafile = datafile_new;
                }
                else
                {
                    datafile = datafile_temp;
                }
                if (inifile.MD5 != null && inifile.MD5.Count > 0)
                {
                    string datahash = HelperFunctions.FileHash(datafile);
                    if (!inifile.MD5.Any(h => h.Equals(datahash, StringComparison.OrdinalIgnoreCase)))
                    {
                        Console.WriteLine("The file {0} is not valid for use with the INI {1}.", datafilename, inifilename);
                        return((int)SplitERRORVALUE.InvalidDataMapping);
                    }
                }
                ByteConverter.BigEndian      = SonicRetro.SAModel.ByteConverter.BigEndian = inifile.BigEndian;
                ByteConverter.Reverse        = SonicRetro.SAModel.ByteConverter.Reverse = inifile.Reverse;
                Environment.CurrentDirectory = Path.Combine(Environment.CurrentDirectory, Path.GetDirectoryName(datafilename));
                if (Path.GetExtension(datafilename).ToLowerInvariant() == ".prs" || (inifile.Compressed && Path.GetExtension(datafilename).ToLowerInvariant() != ".bin"))
                {
                    datafile = FraGag.Compression.Prs.Decompress(datafile);
                }
                uint imageBase = HelperFunctions.SetupEXE(ref datafile) ?? inifile.ImageBase.Value;
                if (Path.GetExtension(datafilename).Equals(".rel", StringComparison.OrdinalIgnoreCase))
                {
                    datafile = HelperFunctions.DecompressREL(datafile);
                    HelperFunctions.FixRELPointers(datafile, imageBase);
                }
                bool            SA2          = inifile.Game == Game.SA2 | inifile.Game == Game.SA2B;
                ModelFormat     modelfmt_def = 0;
                LandTableFormat landfmt_def  = 0;
                switch (inifile.Game)
                {
                case Game.SA1:
                    modelfmt_def = ModelFormat.Basic;
                    landfmt_def  = LandTableFormat.SA1;
                    break;

                case Game.SADX:
                    modelfmt_def = ModelFormat.BasicDX;
                    landfmt_def  = LandTableFormat.SADX;
                    break;

                case Game.SA2:
                    modelfmt_def = ModelFormat.Chunk;
                    landfmt_def  = LandTableFormat.SA2;
                    break;

                case Game.SA2B:
                    modelfmt_def = ModelFormat.GC;
                    landfmt_def  = LandTableFormat.SA2B;
                    break;
                }
                int itemcount = 0;
                Dictionary <string, MasterObjectListEntry>     masterobjlist = new Dictionary <string, MasterObjectListEntry>();
                Dictionary <string, Dictionary <string, int> > objnamecounts = new Dictionary <string, Dictionary <string, int> >();
                Stopwatch timer = new Stopwatch();
                timer.Start();
                foreach (KeyValuePair <string, SA_Tools.FileInfo> item in new List <KeyValuePair <string, SA_Tools.FileInfo> >(inifile.Files))
                {
                    if (string.IsNullOrEmpty(item.Key))
                    {
                        continue;
                    }
                    string                      filedesc         = item.Key;
                    SA_Tools.FileInfo           data             = item.Value;
                    Dictionary <string, string> customProperties = data.CustomProperties;
                    string                      type             = data.Type;
                    int  address = data.Address;
                    bool nohash  = false;

                    string fileOutputPath = Path.Combine(projectFolderName, data.Filename);
                    Console.WriteLine(item.Key + ": " + data.Address.ToString("X") + " → " + fileOutputPath);
                    Directory.CreateDirectory(Path.GetDirectoryName(fileOutputPath));
                    switch (type)
                    {
                    case "landtable":
                        LandTableFormat format = data.CustomProperties.ContainsKey("format") ? (LandTableFormat)Enum.Parse(typeof(LandTableFormat), data.CustomProperties["format"]) : landfmt_def;
                        new LandTable(datafile, address, imageBase, format, labels)
                        {
                            Description = item.Key
                        }.SaveToFile(fileOutputPath, landfmt_def, nometa);
                        break;

                    case "model":
                    case "basicmodel":
                    case "basicdxmodel":
                    case "chunkmodel":
                    case "gcmodel":
                    {
                        ModelFormat mdlformat;
                        switch (type)
                        {
                        case "basicmodel":
                            mdlformat = ModelFormat.Basic;
                            break;

                        case "basicdxmodel":
                            mdlformat = ModelFormat.BasicDX;
                            break;

                        case "chunkmodel":
                            mdlformat = ModelFormat.Chunk;
                            break;

                        case "gcmodel":
                            mdlformat = ModelFormat.GC;
                            break;

                        case "model":
                        default:
                            mdlformat = modelfmt_def;
                            break;
                        }
                        if (data.CustomProperties.ContainsKey("format"))
                        {
                            mdlformat = (ModelFormat)Enum.Parse(typeof(ModelFormat), data.CustomProperties["format"]);
                        }
                        NJS_OBJECT mdl     = new NJS_OBJECT(datafile, address, imageBase, mdlformat, labels, new Dictionary <int, Attach>());
                        string[]   mdlanis = new string[0];
                        if (customProperties.ContainsKey("animations"))
                        {
                            mdlanis = customProperties["animations"].Split(',');
                        }
                        string[] mdlmorphs = new string[0];
                        if (customProperties.ContainsKey("morphs"))
                        {
                            mdlmorphs = customProperties["morphs"].Split(',');
                        }
                        ModelFile.CreateFile(fileOutputPath, mdl, mdlanis, null, item.Key, null, mdlformat, nometa);
                    }
                    break;

                    case "action":
                    {
                        ModelFormat modelfmt_act = data.CustomProperties.ContainsKey("format") ? (ModelFormat)Enum.Parse(typeof(ModelFormat), data.CustomProperties["format"]) : modelfmt_def;
                        NJS_ACTION  ani          = new NJS_ACTION(datafile, address, imageBase, modelfmt_act, labels, new Dictionary <int, Attach>());
                        if (!labels.ContainsValue(ani.Name) && !nolabel)
                        {
                            ani.Name = filedesc;
                        }
                        if (customProperties.ContainsKey("numparts"))
                        {
                            ani.Animation.ModelParts = int.Parse(customProperties["numparts"]);
                        }
                        if (ani.Animation.ModelParts == 0)
                        {
                            Console.WriteLine("Action {0} has no model data!", ani.Name);
                            continue;
                        }
                        ani.Animation.Save(fileOutputPath, nometa);
                    }
                    break;

                    case "animation":
                    case "motion":
                        int numparts = 0;
                        if (customProperties.ContainsKey("numparts"))
                        {
                            numparts = int.Parse(customProperties["numparts"], NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite, NumberFormatInfo.InvariantInfo);
                        }
                        else
                        {
                            Console.WriteLine("Number of parts not specified for {0}", filedesc);
                        }
                        if (customProperties.ContainsKey("shortrot"))
                        {
                            NJS_MOTION mot = new NJS_MOTION(datafile, address, imageBase, numparts, labels, bool.Parse(customProperties["shortrot"]));
                            if (!labels.ContainsKey(address) && !nolabel)
                            {
                                mot.Name = filedesc;
                            }
                            mot.Save(fileOutputPath, nometa);
                        }
                        else
                        {
                            NJS_MOTION mot = new NJS_MOTION(datafile, address, imageBase, numparts, labels);
                            if (!labels.ContainsKey(address) && !nolabel)
                            {
                                mot.Name = filedesc;
                            }
                            mot.Save(fileOutputPath, nometa);
                        }
                        break;

                    case "objlist":
                    {
                        ObjectListEntry[] objs = ObjectList.Load(datafile, address, imageBase, SA2);
                        if (inifile.MasterObjectList != null)
                        {
                            foreach (ObjectListEntry obj in objs)
                            {
                                if (!masterobjlist.ContainsKey(obj.CodeString))
                                {
                                    masterobjlist.Add(obj.CodeString, new MasterObjectListEntry(obj));
                                }
                                if (!objnamecounts.ContainsKey(obj.CodeString))
                                {
                                    objnamecounts.Add(obj.CodeString, new Dictionary <string, int>()
                                        {
                                            { obj.Name, 1 }
                                        });
                                }
                                else if (!objnamecounts[obj.CodeString].ContainsKey(obj.Name))
                                {
                                    objnamecounts[obj.CodeString].Add(obj.Name, 1);
                                }
                                else
                                {
                                    objnamecounts[obj.CodeString][obj.Name]++;
                                }
                            }
                        }
                        objs.Save(fileOutputPath);
                    }
                    break;

                    case "startpos":
                        if (SA2)
                        {
                            SA2StartPosList.Load(datafile, address).Save(fileOutputPath);
                        }
                        else
                        {
                            SA1StartPosList.Load(datafile, address).Save(fileOutputPath);
                        }
                        break;

                    case "texlist":
                        TextureList.Load(datafile, address, imageBase).Save(fileOutputPath);
                        break;

                    case "texnamearray":
                        TexnameArray texnames = new TexnameArray(datafile, address, imageBase);
                        texnames.Save(fileOutputPath);
                        break;

                    case "texlistarray":
                    {
                        int cnt = int.Parse(customProperties["length"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        for (int i = 0; i < cnt; i++)
                        {
                            uint ptr = BitConverter.ToUInt32(datafile, address);
                            if (data.Filename != null && ptr != 0)
                            {
                                ptr -= imageBase;
                                TexnameArray texarr = new TexnameArray(datafile, (int)ptr, imageBase);
                                string       fn     = Path.Combine(fileOutputPath, i.ToString("D3", NumberFormatInfo.InvariantInfo) + ".txt");
                                if (data.CustomProperties.ContainsKey("filename" + i.ToString()))
                                {
                                    fn = Path.Combine(fileOutputPath, data.CustomProperties["filename" + i.ToString()] + ".txt");
                                }
                                if (!Directory.Exists(Path.GetDirectoryName(fn)))
                                {
                                    Directory.CreateDirectory(Path.GetDirectoryName(fn));
                                }
                                texarr.Save(fn);
                            }
                            address += 4;
                        }
                        nohash = true;
                    }
                    break;

                    case "leveltexlist":
                        new LevelTextureList(datafile, address, imageBase).Save(fileOutputPath);
                        break;

                    case "triallevellist":
                        TrialLevelList.Save(TrialLevelList.Load(datafile, address, imageBase), fileOutputPath);
                        break;

                    case "bosslevellist":
                        BossLevelList.Save(BossLevelList.Load(datafile, address), fileOutputPath);
                        break;

                    case "fieldstartpos":
                        FieldStartPosList.Load(datafile, address).Save(fileOutputPath);
                        break;

                    case "soundtestlist":
                        SoundTestList.Load(datafile, address, imageBase).Save(fileOutputPath);
                        break;

                    case "musiclist":
                    {
                        int muscnt = int.Parse(customProperties["length"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        MusicList.Load(datafile, address, imageBase, muscnt).Save(fileOutputPath);
                    }
                    break;

                    case "soundlist":
                        SoundList.Load(datafile, address, imageBase).Save(fileOutputPath);
                        break;

                    case "stringarray":
                    {
                        int       cnt  = int.Parse(customProperties["length"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        Languages lang = Languages.Japanese;
                        if (data.CustomProperties.ContainsKey("language"))
                        {
                            lang = (Languages)Enum.Parse(typeof(Languages), data.CustomProperties["language"], true);
                        }
                        StringArray.Load(datafile, address, imageBase, cnt, lang).Save(fileOutputPath);
                    }
                    break;

                    case "nextlevellist":
                        NextLevelList.Load(datafile, address).Save(fileOutputPath);
                        break;

                    case "cutscenetext":
                    {
                        int cnt = int.Parse(customProperties["length"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        new CutsceneText(datafile, address, imageBase, cnt).Save(fileOutputPath, out string[] hashes);
                        data.MD5Hash = string.Join(",", hashes);
                        nohash       = true;
                    }
                    break;

                    case "recapscreen":
                    {
                        int cnt = int.Parse(customProperties["length"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        RecapScreenList.Load(datafile, address, imageBase, cnt).Save(fileOutputPath, out string[][] hashes);
                        string[] hash2 = new string[hashes.Length];
                        for (int i = 0; i < hashes.Length; i++)
                        {
                            hash2[i] = string.Join(",", hashes[i]);
                        }
                        data.MD5Hash = string.Join(":", hash2);
                        nohash       = true;
                    }
                    break;

                    case "npctext":
                    {
                        int cnt = int.Parse(customProperties["length"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        NPCTextList.Load(datafile, address, imageBase, cnt).Save(fileOutputPath, out string[][] hashes);
                        string[] hash2 = new string[hashes.Length];
                        for (int i = 0; i < hashes.Length; i++)
                        {
                            hash2[i] = string.Join(",", hashes[i]);
                        }
                        data.MD5Hash = string.Join(":", hash2);
                        nohash       = true;
                    }
                    break;

                    case "levelclearflags":
                        LevelClearFlagList.Save(LevelClearFlagList.Load(datafile, address), fileOutputPath);
                        break;

                    case "deathzone":
                    {
                        List <DeathZoneFlags> flags = new List <DeathZoneFlags>();
                        string        path          = Path.GetDirectoryName(fileOutputPath);
                        List <string> hashes        = new List <string>();
                        int           num           = 0;
                        while (ByteConverter.ToUInt32(datafile, address + 4) != 0)
                        {
                            string file_tosave;
                            if (customProperties.ContainsKey("filename" + num.ToString()))
                            {
                                file_tosave = customProperties["filename" + num++.ToString()];
                            }
                            else
                            {
                                file_tosave = num++.ToString(NumberFormatInfo.InvariantInfo) + ".sa1mdl";
                            }
                            string file = Path.Combine(path, file_tosave);
                            flags.Add(new DeathZoneFlags(datafile, address, file_tosave));
                            ModelFormat modelfmt_death = inifile.Game == Game.SADX ? ModelFormat.BasicDX : ModelFormat.Basic;                                             // Death zones in all games except SADXPC use Basic non-DX models
                            ModelFile.CreateFile(file, new NJS_OBJECT(datafile, datafile.GetPointer(address + 4, imageBase), imageBase, modelfmt_death, new Dictionary <int, Attach>()), null, null, null, null, modelfmt_death, nometa);
                            hashes.Add(HelperFunctions.FileHash(file));
                            address += 8;
                        }
                        flags.ToArray().Save(fileOutputPath);
                        hashes.Insert(0, HelperFunctions.FileHash(fileOutputPath));
                        data.MD5Hash = string.Join(",", hashes.ToArray());
                        nohash       = true;
                    }
                    break;

                    case "skyboxscale":
                    {
                        int cnt = int.Parse(customProperties["count"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        SkyboxScaleList.Load(datafile, address, imageBase, cnt).Save(fileOutputPath);
                    }
                    break;

                    case "stageselectlist":
                    {
                        int cnt = int.Parse(customProperties["count"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        StageSelectLevelList.Load(datafile, address, cnt).Save(fileOutputPath);
                    }
                    break;

                    case "levelrankscores":
                        LevelRankScoresList.Load(datafile, address).Save(fileOutputPath);
                        break;

                    case "levelranktimes":
                        LevelRankTimesList.Load(datafile, address).Save(fileOutputPath);
                        break;

                    case "endpos":
                        SA2EndPosList.Load(datafile, address).Save(fileOutputPath);
                        break;

                    case "animationlist":
                    {
                        int cnt = int.Parse(customProperties["count"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        SA2AnimationInfoList.Load(datafile, address, cnt).Save(fileOutputPath);
                    }
                    break;

                    case "enemyanimationlist":
                    {
                        int cnt = int.Parse(customProperties["count"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        SA2EnemyAnimInfoList.Load(datafile, address, imageBase, cnt).Save(fileOutputPath);
                    }
                    break;

                    case "sa1actionlist":
                    {
                        int cnt = int.Parse(customProperties["count"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        SA1ActionInfoList.Load(datafile, address, imageBase, cnt).Save(fileOutputPath);
                    }
                    break;

                    case "motiontable":
                    {
                        Directory.CreateDirectory(fileOutputPath);
                        List <MotionTableEntry> result = new List <MotionTableEntry>();
                        List <string>           hashes = new List <string>();
                        bool shortrot = false;
                        if (customProperties.ContainsKey("shortrot"))
                        {
                            shortrot = bool.Parse(customProperties["shortrot"]);
                        }
                        int nodeCount = int.Parse(data.CustomProperties["nodecount"], NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite, NumberFormatInfo.InvariantInfo);
                        int Length    = int.Parse(data.CustomProperties["length"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        Dictionary <int, string> mtns = new Dictionary <int, string>();
                        for (int i = 0; i < Length; i++)
                        {
                            MotionTableEntry bmte = new MotionTableEntry();
                            int mtnaddr           = (int)(ByteConverter.ToUInt32(datafile, address) - imageBase);
                            if (!mtns.ContainsKey(mtnaddr))
                            {
                                NJS_MOTION motion = new NJS_MOTION(datafile, mtnaddr, imageBase, nodeCount, null, shortrot);
                                bmte.Motion = motion.Name;
                                mtns.Add(mtnaddr, motion.Name);
                                motion.Save(Path.Combine(fileOutputPath, $"{i}.saanim"), nometa);
                                hashes.Add($"{i}.saanim:" + HelperFunctions.FileHash(Path.Combine(fileOutputPath, $"{i}.saanim")));
                            }
                            else
                            {
                                bmte.Motion = mtns[mtnaddr];
                            }
                            bmte.LoopProperty    = ByteConverter.ToUInt16(datafile, address + 4);
                            bmte.Pose            = ByteConverter.ToUInt16(datafile, address + 6);
                            bmte.NextAnimation   = ByteConverter.ToInt32(datafile, address + 8);
                            bmte.TransitionSpeed = ByteConverter.ToUInt32(datafile, address + 0xC);
                            bmte.StartFrame      = ByteConverter.ToSingle(datafile, address + 0x10);
                            bmte.EndFrame        = ByteConverter.ToSingle(datafile, address + 0x14);
                            bmte.PlaySpeed       = ByteConverter.ToSingle(datafile, address + 0x18);
                            result.Add(bmte);
                            address += 0x1C;
                        }
                        IniSerializer.Serialize(result, Path.Combine(fileOutputPath, "info.ini"));
                        hashes.Add("info.ini:" + HelperFunctions.FileHash(Path.Combine(fileOutputPath, "info.ini")));
                        data.MD5Hash = string.Join("|", hashes.ToArray());
                        nohash       = true;
                    }
                    break;

                    case "levelpathlist":
                    {
                        List <string> hashes = new List <string>();
                        ushort        lvlnum = (ushort)ByteConverter.ToUInt32(datafile, address);
                        while (lvlnum != 0xFFFF)
                        {
                            int ptr = ByteConverter.ToInt32(datafile, address + 4);
                            if (ptr != 0)
                            {
                                ptr = (int)((uint)ptr - imageBase);
                                SA1LevelAct level  = new SA1LevelAct(lvlnum);
                                string      lvldir = Path.Combine(fileOutputPath, level.ToString());
                                PathList.Load(datafile, ptr, imageBase).Save(lvldir, out string[] lvlhashes);
                                hashes.Add(level.ToString() + ":" + string.Join(",", lvlhashes));
                            }
                            address += 8;
                            lvlnum   = (ushort)ByteConverter.ToUInt32(datafile, address);
                        }
                        data.MD5Hash = string.Join("|", hashes.ToArray());
                        nohash       = true;
                    }
                    break;

                    case "pathlist":
                    {
                        PathList.Load(datafile, address, imageBase).Save(fileOutputPath, out string[] hashes);
                        data.MD5Hash = string.Join(",", hashes.ToArray());
                        nohash       = true;
                    }
                    break;

                    case "stagelightdatalist":
                        SA1StageLightDataList.Load(datafile, address).Save(fileOutputPath);
                        break;

                    case "weldlist":
                        WeldList.Load(datafile, address, imageBase).Save(fileOutputPath);
                        break;

                    case "bmitemattrlist":
                        BlackMarketItemAttributesList.Load(datafile, address, imageBase).Save(fileOutputPath);
                        break;

                    case "creditstextlist":
                        CreditsTextList.Load(datafile, address, imageBase).Save(fileOutputPath);
                        break;

                    case "animindexlist":
                    {
                        Directory.CreateDirectory(fileOutputPath);
                        List <string> hashes = new List <string>();
                        int           i      = ByteConverter.ToInt16(datafile, address);
                        while (i != -1)
                        {
                            new NJS_MOTION(datafile, datafile.GetPointer(address + 4, imageBase), imageBase, ByteConverter.ToInt16(datafile, address + 2))
                            .Save(fileOutputPath + "/" + i.ToString(NumberFormatInfo.InvariantInfo) + ".saanim", nometa);
                            hashes.Add(i.ToString(NumberFormatInfo.InvariantInfo) + ":" + HelperFunctions.FileHash(fileOutputPath + "/" + i.ToString(NumberFormatInfo.InvariantInfo) + ".saanim"));
                            address += 8;
                            i        = ByteConverter.ToInt16(datafile, address);
                        }
                        data.MD5Hash = string.Join("|", hashes.ToArray());
                        nohash       = true;
                    }
                    break;

                    case "storysequence":
                        SA2StoryList.Load(datafile, address).Save(fileOutputPath);
                        break;

                    case "masterstringlist":
                    {
                        int cnt = int.Parse(customProperties["length"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        for (int l = 0; l < 5; l++)
                        {
                            Languages            lng = (Languages)l;
                            System.Text.Encoding enc = HelperFunctions.GetEncoding(inifile.Game, lng);
                            string ld = Path.Combine(fileOutputPath, lng.ToString());
                            Directory.CreateDirectory(ld);
                            int ptr = datafile.GetPointer(address, imageBase);
                            for (int i = 0; i < cnt; i++)
                            {
                                int ptr2 = datafile.GetPointer(ptr, imageBase);
                                if (ptr2 != 0)
                                {
                                    string fn = Path.Combine(ld, $"{i}.txt");
                                    File.WriteAllText(fn, datafile.GetCString(ptr2, enc).Replace("\n", "\r\n"));
                                    inifile.Files.Add($"{filedesc} {lng} {i}", new FileInfo()
                                        {
                                            Type = "string", Filename = fn, PointerList = new int[] { ptr }, MD5Hash = HelperFunctions.FileHash(fn), CustomProperties = new Dictionary <string, string>()
                                            {
                                                { "language", lng.ToString() }
                                            }
                                        });
                                }
                                ptr += 4;
                            }
                            address += 4;
                        }
                        inifile.Files.Remove(filedesc);
                        nohash = true;
                    }
                    break;

                    case "camera":
                        NinjaCamera cam = new NinjaCamera(datafile, address);
                        cam.Save(fileOutputPath);
                        break;

                    case "fogdatatable":
                        int fcnt = 3;
                        if (customProperties.ContainsKey("count"))
                        {
                            fcnt = int.Parse(customProperties["count"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        }
                        FogDataTable fga = new FogDataTable(datafile, address, imageBase, fcnt);
                        fga.Save(fileOutputPath);
                        break;

                    case "palettelightlist":
                        int count = 255;
                        if (customProperties.ContainsKey("count"))
                        {
                            count = int.Parse(customProperties["count"], NumberStyles.Integer, NumberFormatInfo.InvariantInfo);
                        }
                        PaletteLightList pllist = new PaletteLightList(datafile, address, count);
                        pllist.Save(fileOutputPath);
                        break;

                    case "physicsdata":
                        PlayerParameter plpm = new PlayerParameter(datafile, address);
                        plpm.Save(fileOutputPath);
                        break;

                    default:                             // raw binary
                    {
                        byte[] bin = new byte[int.Parse(customProperties["size"], NumberStyles.HexNumber)];
                        Array.Copy(datafile, address, bin, 0, bin.Length);
                        File.WriteAllBytes(fileOutputPath, bin);
                    }
                    break;
                    }
                    if (!nohash)
                    {
                        data.MD5Hash = HelperFunctions.FileHash(fileOutputPath);
                    }
                    itemcount++;
                }
                if (inifile.MasterObjectList != null)
                {
                    foreach (KeyValuePair <string, MasterObjectListEntry> obj in masterobjlist)
                    {
                        KeyValuePair <string, int> name = new KeyValuePair <string, int>();
                        foreach (KeyValuePair <string, int> it in objnamecounts[obj.Key])
                        {
                            if (it.Value > name.Value)
                            {
                                name = it;
                            }
                        }
                        obj.Value.Name  = name.Key;
                        obj.Value.Names = objnamecounts[obj.Key].Select((it) => it.Key).ToArray();
                    }

                    string masterObjectListOutputPath = Path.Combine(projectFolderName, inifile.MasterObjectList);

                    IniSerializer.Serialize(masterobjlist, masterObjectListOutputPath);
                }
                IniSerializer.Serialize(inifile, Path.Combine(projectFolderName, Path.GetFileNameWithoutExtension(inifilename) + "_data.ini"));
                timer.Stop();
                Console.WriteLine("Split " + itemcount + " items in " + timer.Elapsed.TotalSeconds + " seconds.");
                Console.WriteLine();
            }
#if !DEBUG
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
                Console.WriteLine("Press any key to exit.");
                Console.ReadLine();
                return((int)SplitERRORVALUE.UnhandledException);
            }
#endif
            return((int)SplitERRORVALUE.Success);
        }
Beispiel #37
0
 void Start()
 {
     playerParameter = GetComponent<PlayerParameter>();
     _jumpPower = playerParameter.getJumpPower;
 }
 public HungryEconomy(PlayerParameter.HungerSpeedType hungerspeed)
     : base(AbilityLevel.ONE)
 {
     HungerSpeed = hungerspeed;
     PreviousSpeed = PlayerParameter.HungerSpeedType.NORMAL;
 }
Beispiel #39
0
 public RightSideMoveCommand(ICharacterComponent character)
     : base(character)
 {
     playerMove      = Character.CharacterTransform.GetComponent <PlayerMove>();
     playerParameter = Character.CharacterTransform.GetComponent <PlayerParameter>();
 }
Beispiel #40
0
    // Use this for initialization
    void Start()
    {
        controller = GetComponent<CharacterController>();
        bullet = Resources.Load("PlayerBullet") as GameObject;
        playerParameter = GetComponent<PlayerParameter>();
        powerUpParameter = GetComponent<PowerUpParameter>();

        IsDead = false;
        isDash = false;
    }
 public HungryEconomy(PlayerParameter.HungerSpeedType hungerspeed)
     : base(AbilityLevel.ONE)
 {
     HungerSpeed = hungerspeed;
 }