| 赞 | 0  | 
 
| VIP | 0 | 
 
| 好人卡 | 0 | 
 
| 积分 | 0 | 
 
| 经验 | 0 | 
 
| 最后登录 | 2021-3-20 | 
 
| 在线时间 | 11 小时 | 
 
 
 
 
 
Lv1.梦旅人 
	- 梦石
 - 0 
 
        - 星屑
 - 46 
 
        - 在线时间
 - 11 小时
 
        - 注册时间
 - 2021-3-12
 
        - 帖子
 - 3
 
 
 
 | 
	
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
x
 
本人新手一个,于是开个记录贴,记录一些简单代码功能,如有错误望大佬指正  
 
敌人偷窃: 
$gameParty.loseItem($gameParty.allItems()[Math.floor(Math.random() * $gameParty.allItems().length)], 1); 
目前来说还有缺陷,怪消灭后无法取回丢失物品,正在往数组方面考虑 
 
业余注释: $gameParty.allItems().length 检索物品栏长度 
                Math.floor() 取整(无4舍5入) 
                Math.random()  0~1 随机 
               $gameParty.allItems()[] 获取物品id 
               $gameParty.loseItem() 物品id丢失 
 
队伍是否有某个状态判定 
var a = true; 
for(var i = 0;i < $gameParty._actors.length;i++){ 
if ($gameActors.actor($gameParty._actors[i]).isStateAffected(36)){ 
   a = false; 
   break; 
   } 
} 
 
if(a){ 
$gameSwitches.setValue(3,true); 
} 
 
业余注释: $gameParty._actors.length 获取队伍人数 
               $gameParty._actors[人物id]).isStateAffected(状态id) 判定人物是否有某个状态 |   
 
 
 
 |