const treasurePlace = (数据.读(['宝藏', '位置']) ?? "")
const place = 玩家.位置
var res = 0
var rdm = Math.random() // 挖掘是否成功指数
var resTxt = `〖你位于${place},宝藏位于${treasurePlace},挖掘成功指数${rdm}(小于等于0.3视为成功)〗`
if (place === treasurePlace && rdm <= 0.3) {
var rdm2 = Math.random() // 挖掘结果指数
if (rdm2 <= 0.2) res = 1;
else if (rdm2 <= 0.2 + 0.2) res = 2;
else if (rdm2 <= 0.2 + 0.2 + 0.2) res = 3;
else if (rdm2 <= 0.2 + 0.2 + 0.2 + 0.15) res = 4;
else res = 5;
resTxt += `\n〖挖掘成功,挖掘结果指数${rdm2},挖掘结果为${res}〗`
}
switch (res) {
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
default:
break;
}
属性.临时文本 = resTxt
const 随机地点组 = ['地图一', '地图二', '地图三', '地图四']
const place = 随机数(随机地点组)
数据.写(['宝藏', '位置'], place)
属性.临时文本 = place