OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/h58pcdgame/GameScriptCore...
authorttwilb <ttwilb@users.sourceforge.jp>
Mon, 2 Sep 2013 09:19:01 +0000 (18:19 +0900)
committerttwilb <ttwilb@users.sourceforge.jp>
Mon, 2 Sep 2013 09:19:01 +0000 (18:19 +0900)
www/corelib/classes/MainCharacterClass.js
www/corelib/coresubc.js
www/stage/select.js

index 1fb9d73..318e8da 100644 (file)
@@ -32,3 +32,28 @@ var MainCharacterClass = function(stage, args){
                //終了処理および再読み込みはmainManager側で行われる。
        },
 });
+
+MainCharacterClass.createCharacter = function(stage, args)
+{
+       var id = stage.manager.userManager.characterId;
+       if(id == 0)
+       {
+               return new MainCharacterClass_Hunter(stage, args);
+       }else if(id == 1)
+       {
+               return new MainCharacterClass_Man(stage, args);
+       }else if(id == 2)
+       {
+               return new MainCharacterClass_NakedMan(stage, args);
+       }else if(id == 3)
+       {
+               return new MainCharacterClass_Thief(stage, args);
+       }else if(id == 4)
+       {
+               return new MainCharacterClass_Witch(stage, args);
+       }else if(id == 5)
+       {
+               return new MainCharacterClass_Woman(stage, args);
+       }
+};
+
index 00a837f..80e18e6 100644 (file)
@@ -301,6 +301,8 @@ function UserManager(mManager){
        this.breadList = new Array();
        //this.max_HP = 100;
        //this.HP = this.max_HP;
+       
+       this.characterId = 0;
 }
 UserManager.prototype = {
        loginAs: function(userNameStr){
index b8f8f76..7c64db4 100644 (file)
@@ -5,12 +5,28 @@
 stage = new GameStage();
 
 stage.stageNameList = new Array();
+stage.charaNameList = new Array();
 
 //関数のオーバーライド
 stage.runStage = function(){
        //元々定義されていた、疑似スーパークラス(prototype)の関数を呼び出す。
        GameStage.prototype.runStage.apply(this, []);
        var that = this;
+       var f2 = function(stgName)
+       {
+               var f3 = function(cid)
+               {
+                       if(!cid) cid = 0;
+                       mainManager.userManager.characterId  = cid;
+                       //ステージ読み込み
+                       mainManager.loadStageFromNetwork(stgName);
+               };
+               
+               var sw2 = new SelectWidgetClass(mainManager, [this.charaNameList, f3, false, 0, true]);
+               sw2.enableCancel = false;
+               mainManager.addWidget(sw2);
+                               
+       };
        var f = function(retv){
                var tryAgain = true;
                if(retv){
@@ -23,8 +39,7 @@ stage.runStage = function(){
                        sw.enableCancel = false;
                        mainManager.addWidget(sw);
                } else{
-                       //ステージ読み込み
-                       mainManager.loadStageFromNetwork(retv[0].stgName);
+                       f2(retv[0].stgName);
                }
        };
        var sw = new SelectWidgetClass(mainManager, [this.stageNameList, f, false, 0, true]);
@@ -38,6 +53,13 @@ stage.getSelectWidgetItemFromStageName = function(title, stgName, selected){
        return item;
 }
 
+stage.getSelectWidgetItemFromCharacter = function(title, val)
+{
+       var item = new SelectWidgetItemClass(true, title, null, false, "キャラクターを選択してください。");
+       item.val = val;
+       return item;
+}
+
 var s;
 s = stage.getSelectWidgetItemFromStageName("街","city", true);
 stage.stageNameList.push(s);
@@ -51,6 +73,16 @@ s = stage.getSelectWidgetItemFromStageName("森","pengin");
 stage.stageNameList.push(s);
 s = stage.getSelectWidgetItemFromStageName("海","sea");
 stage.stageNameList.push(s);
-
-
+s = stage.getSelectWidgetItemFromCharacter("森の狩人", 0);
+stage.charaNameList.push(s);
+s = stage.getSelectWidgetItemFromCharacter("村の青年", 1);
+stage.charaNameList.push(s);
+s = stage.getSelectWidgetItemFromCharacter("酔っ払い", 2);
+stage.charaNameList.push(s);
+s = stage.getSelectWidgetItemFromCharacter("盗賊", 3);
+stage.charaNameList.push(s);
+s = stage.getSelectWidgetItemFromCharacter("魔女", 4);
+stage.charaNameList.push(s);
+s = stage.getSelectWidgetItemFromCharacter("町女", 5);
+stage.charaNameList.push(s);
 stage;