提交中
📝正在回复 #1377360
jvk2iOze 2025-03-04 18:17:40
游戏开发日志
jvk2iOze Po 2025-03-28 19:10:48
<<if $hunger<10 || $water<10 || $life<50 >>
<<if $power >20 >>
<<set $power=20>>
<<endif>>
<<endif>>
<<set $powerpass=0>>
/*生命恢复*/
<<if $hunger>0 && $water>0 >>
<<set $lifepass+=$timepass>>
<<set $life +=Math.floor($lifepass/360)>>
<<set $lifepass=$lifepass%360>>
<<if $life >100 >>
<<set $life=100>>
<<endif>>
<<endif>>
jvk2iOze Po 2025-03-28 19:11:20
/*时间进制*/

<<set $minute += $timepass%60>>
<<set $hour += $hourpass>>

<<if $minute >= 60>>
<<set $hour += 1>>
<<set $minute = $minute - 60>>
<<endif>>
<<if $minute < 10 >>
<<set $showminute = '0'+$minute>>
<<else>>
<<set $showminute = $minute>>
<<endif>>

<<if $hour >= 24 >>
<<set $hour = $hour - 24>>
<<set $day += 1>>
<<set $showday += 1>>
<<set $wavetem to random(-1,3)>>
<<set $weather to random(1,9)>>
<<endif>>
<<if $hour < 10 >>
<<set $showhour = '0' + $hour>>
<<else>>
<<set $showhour = $hour>>
<<endif>>
<<if $showday >= 34 && $season <4 >>
<<set $showday = $showday - 33>>
<<set $season += 1>>
<<endif>>
jvk2iOze Po 2025-03-28 19:11:38
<<if $season==4 && $showday>=2>>
<<set $showday = $showday - 1>>
<<set $season = 1>>
<<endif>>

<<if $season == 1>>
<<set $showseason = '丰饶'>>
<<else>>
<<if $season == 2>>
<<set $showseason = '日曜'>>
<<else>>
<<if $season == 3>>
<<set $showseason = '凛冬'>>
<<else>>
<<set $showseason='冰封'>>
<<endif>>
<<endif>>
<<endif>>
jvk2iOze Po 2025-03-28 19:12:38
/*天气*/
<<if $season==4>>
<<set $weather=0>>
<<else>>
<<if $season ==2 && $weather==1 >>
<<set $weather = 2>>
<<else>>
<<if $season ==3 && $weather==2 >>
<<set $weather =1>>
<<else>>
<<if $season ==1 && $weather<3 >>
<<set $weather +=2 >>
<<endif>>
<<endif>>
<<endif>>
<<endif>>
jvk2iOze Po 2025-03-28 19:13:29
/*环境温度判定*/
<<if $season==1 >>
<<if $showday==1>>
<<set $seasontem=15>>
<<else>>
<<set $seasontem=15+Math.floor($showday/3)>>
<<endif>>
<<endif>>

<<if $season==2 >>
<<if $showday==1>>
<<set $seasontem=26>>
<<else>>
<<if $showday<21>>
<<set $seasontem=26+Math.floor($showday/2)>>
<<else>>
<<if $showday==21>>
<<set $seasontem=35>>
<<else>>
<<set $seasontem=35-($showday-21)*2>>
<<endif>>
<<endif>>
<<endif>>
<<endif>>

<<if $season==3 >>
<<if $showday==1>>
<<set $seasontem=10>>
<<else>>
<<set $seasontem=10-Math.floor($showday/3)>>
<<endif>>
<<endif>>
<<if $season==3 && $seasontem <0 >>
<<set $seasontem=0>>
<<endif>>
jvk2iOze Po 2025-03-28 19:14:56
<<if $depth == -1 >>
<<set _worldtem=$weatem[$weather]+$seasontem+$wavetem>>
<<else>>
<<if $depth<200>>
<<set _worldtem=$seasontem+$wavetem>>
<<else>>
<<if $depth<1000>>
<<set _worldtem = Math.floor($seasontem / 5)>>
<<else>>
<<set _worldtem=0>>
<<endif>>
<<endif>>
<<endif>>

<<if $outdoor==0 && _worldtem < 10>>
<<set $worldtem=_worldtem+3>>
<<else>>
<<if $outdoor==0 && _worldtem >30 >>
<<set $worldtem=_worldtem-3>>
<<else>>
<<set $worldtem= _worldtem>>
<<endif>>
<<endif>>
jvk2iOze Po 2025-03-28 19:15:52
/*湿度判定*/

<<if $outdoor == 1>>
<<if $weather == 6>>
<<set $wetpass += $timepass>>
<<set $wet += Math.floor($wetpass / 3)>>
<<set $wetpass = $wetpass % 3>>
<<elseif $weather == 7>>
<<set $wetpass += $timepass>>
<<set $wet += $wetpass>>
<<set $wetpass = 0>>
<<elseif $weather == 9>>
<<set $wetpass += $timepass * 2>>
<<set $wet += $wetpass>>
<<set $wetpass = 0>>
<<endif>>
<<endif>>
<<if $outdoor == 1 && $weather == 2>>
<<set $wetpass += $timepass>>
<<set $wet -= Math.floor($wetpass / 2)>>
<<set $wetpass = $wetpass % 2>>
<<elseif $outdoor == 1 && $weather == 4>>
<<set $wetpass += $timepass>>
<<set $wet -= Math.floor($wetpass / 4)>>
<<set $wetpass = $wetpass % 4>>
<<elseif $worldtem >= 30>>
<<set $wetpass += $timepass>>
<<set $wet -= Math.floor($wetpass / 3)>>
<<set $wetpass = $wetpass % 3>>
<<endif>>
jvk2iOze Po 2025-03-28 19:16:56
<<if $inwater==1>>
<<set $wet=100>>
<<endif>>

<<if $fire == 1>>
<<set $wetpass += $timepass>>
<<set $wet -= Math.floor($wetpass / 3)>>
<<set $wetpass = $wetpass % 3>>
<<endif>>
<<set $wetpass=0>>


<<if $wet<0>>
<<set $wet=0>>
<<endif>>


<<if $wet>100>>
<<set $wet=100>>
<<endif>>
<<if $wet>50>>
<<set $wettem=$cloth+Math.floor($wet/10)>>
<<else>>
<<if $wet>20>>
<<set $wettem=Math.floor($wet/8)>>
<<else>>
<<set $wettem=0>>
<<endif>>
<<endif>>
jvk2iOze Po 2025-03-28 19:18:03
/*自身温度*/

<<set $tem=$worldtem+$cloth-$wettem+$addtem>>

<<if $bath>0>>
<<set $tem=$bath>>
<<endif>>
<<set _cozy=0>>
<<if $tem >= 18 && $tem <= 26>>
<<set _cozy = -5>>
<<set $heatpass -=$timepass*2 >>
<<set $coldpass-=$timepass*2>>
<<elseif $tem >= 32>>
<<set _cozy = 5>>
<<set $coldpass-=$timepass*3>>
<<set $water-=$timepass/20>>
<<if $tem>37>>
<<set $heatpass += $timepass*2>>
<<else>>
<<set $heatpass+= $timepass>>
<<endif>>
<<if $heatpass >= 0>>
<<set $health -= $timepass>>
<<endif>>
<<elseif $tem <= 10>>
<<set _cozy = 5>>
<<set $heatpass -=$timepass*3 >>
<<if $power>50>>
<<set $power=50>>
<<endif>>
<<if $tem<=0>>
<<set $coldpass += $timepass*2>>
<<else>>
<<set $coldpass+= $timepass>>
<<endif>>
<<set $coldpass += timepass>>
<<if $coldpass >= 0>>
<<set $health -=$timepass>>
<<endif>>
jvk2iOze Po 2025-03-28 19:18:26
<<else>>
<<set _cozy = 0>>
<<set $heatpass -= $timepass>>
<<set $coldpass-=$timepass>>
<<endif>>

<<if $heatpass<-120>>
<<set $heatpass=-120>>
<<endif>>
<<if $coldpass<-120>>
<<set $coldpass=-120>>
<<endif>>
<<if $life <0 >>
<<set $life = 0>>
<<endif>>
jvk2iOze Po 2025-03-28 19:23:58
/*压力变化*/
<<set _tre to random(20,25)>>

<<if $life<25>>
<<set _life=Math.floor((100-$life)/2)>>
<<else>>
<<if $life<50>>
<<set _life=8+Math.floor((100-$life)/7)>>
<<else>>
<<if $life<90>>
<<set _life=3+Math.floor((100-$life)/10)>>
<<else>>
<<if $life==100>>
<<set _life=-5>>
<<else>>
<<set _life=0>>
<<endif>>
<<endif>>
<<endif>>
<<endif>>
<<if $hunger<25>>
<<set _hun=5+Math.floor((100-$hunger)/10)>>
<<else>>
<<if $hunger<50>>
<<set _hun=Math.floor((100-$hunger)/10)>>
<<else>>
<<if $hunger>80>>
<<set _hun=-5>>
<<else>>
<<set _hun=0>>
<<endif>>
<<endif>>
<<endif>>
jvk2iOze Po 2025-03-28 19:24:23
<<if $water<25>>
<<set _wat=5+Math.floor((100-$water)/10)>>
<<else>>
<<if $water<50>>
<<set _wat=Math.floor((100-$water)/10)>>
<<else>>
<<if $water>80>>
<<set _wat=-5>>
<<else>>
<<set _wat=0>>
<<endif>>
<<endif>>
<<endif>>

<<set $tre=_tre+_hun+_wat+_life+_cozy>>
<<if $tre <0>>
<<set $tre =0>>
<<endif>>
<<if $tre >100>>
<<set $tre =100>>
<<endif>>
jvk2iOze Po 2025-03-28 19:25:00
/*san check*/
<<if $tre>80 && $tre<100>>
<<set $sanpass+=$timepass>>
<<set $san -=Math.floor($sanpass/60)>>
<<set $sanpass=$sanpass%60>>
<<else>>
<<if $tre==100>>
<<set $sanpass+=$timepass>>
<<set $san-=10>>
<<set $san -=Math.floor($sanpass/30)>>
<<set $sanpass=$sanpass%30>>
<<else>>
<<if $tre<=15>>
<<set $sanpass+=$timepass>>
<<set $san +=Math.floor($sanpass/30)>>
<<set $sanpass=$sanpass%30>>
<<endif>>
<<endif>>
<<endif>>

<<if $san <0 >>
<<set $san=0>>
<<endif>>
<<if $san >100 >>
<<set $san = 100>>
<<endif>>


<<set $hourpass = 0>>
<<set $timepass = 0>>



<</widget>>
<</nobr>>
jvk2iOze Po 2025-03-28 19:26:47
以上是六维变化的time组件,基本全是新手语句,还真的堆了不少[ ゚π。]一会儿把sail组件放一下
jvk2iOze Po 2025-03-28 19:27:42
<<nobr>>
<<widget "sail">>
/* 更新航行状态 */
<<set $map += 1>>
<<set $sailpass += 1>>
<<set $depthpass += 1>>
<<set $timepass+=1>>
/* 判断是否跨区 */
<<if $map >= $maplim>>
<<set $map = 0>> /* 重置当前坐标 */
<<set _keys = Object.keys($mapinfo)>>
<<if _keys.length > 0>>
<<set _totalWeight = 0>>
<<for _key range _keys>>
<<set _totalWeight += $mapinfo[_key].weight>>
<</for>>
<<set _randomWeight = Math.floor(Math.random() * _totalWeight)>>
<<set _currentWeight = 0>>
<<for _key range _keys>>
<<set _currentWeight += $mapinfo[_key].weight>>
<<if _randomWeight < _currentWeight>>
<<set $maptype = _key>>
<<break>>
<</if>>
<</for>>
<<else>>
<<set $maptype = "sand">> /* 默认地图类型 */
<</if>>
jvk2iOze Po 2025-03-28 19:28:00
/* 生成新的 maplim 和 depthdeep */
<<set $maplim = Math.floor(Math.random() * ($mapinfo[$maptype].spanmax - $mapinfo[$maptype].spanmin + 1)) + $mapinfo[$maptype].spanmin>>
<<set $depthdeep = Math.floor(Math.random() * ($mapinfo[$maptype].depthmax - $mapinfo[$maptype].depthmin + 1)) + $mapinfo[$maptype].depthmin>>
<</if>>

/* 深度变化 */
<<set $depthdeep=Number($depthdeep)+Number($depthspd)>> /* 确保数值计算 */

/* 判断是否需要重置 depthwave 和 depthspd */
<<if $depthpass > $depthwave || $depthdeep >= $mapinfo[$maptype].depthmax || $depthdeep <= $mapinfo[$maptype].depthmin>>
<<set $depthwave = Math.floor(Math.random() * 151) + 50>> /* 50~200 随机整数 */
<<set $depthspd = Math.floor(
Math.random() * ($mapinfo[$maptype].spdmax - $mapinfo[$maptype].spdmin + 1)
) + $mapinfo[$maptype].spdmin>> /* 在 spdmin~spdmax 之间随机取整 */
<<set $depthpass = 0>> /* 重置计数器 */
<</if>>
<</widget>>
<</nobr>>
jvk2iOze Po 2025-03-28 19:29:36
这样就可以在手机上看了方便多了,而且随时可以记修改的想法!
感觉现行的depthspd还得改,不过应该很快,不取整然后深度取整显示就好了,可以加个不取整的变量记录
jvk2iOze Po 2025-03-28 20:02:43
目前所有区域深度范围里应该都有重合,至少相近,所以也许应该提前生成下一个区域的初始深度,然后提前开始变化?
感觉可行,在进入后100段时判断下一个区域的初始深度和当前深度趋势,差异>200就重新生成,然后固定一个spd进行变化
jvk2iOze Po 2025-03-28 20:04:33
不对,如果上一个深度末尾是深度-8000,下一个深度是珊瑚礁的话怎么都没办法切换啊
jvk2iOze Po 2025-03-28 20:05:54
判定当前深度是否能进入下一个区域,不行的话切换区域
是否立即朝美国发射核弹?
为 #654 送出表情
上下滚动,选择表情
👍 赞!
👎 这不好
😆 欢乐
🎉 烟花
😕 嗯...
💗 爱心
🐱 喵喵喵
🐭 鼠鼠我呀
🐔
🐷 猪头
🐶 我是狗?
冲刺!冲!
😱 吓死了
👀 就看看
🤡 小丑
🀄 太中咧!
🤣 笑哭
😅 这...
😫 痛苦面具
😭 我哭死
😋 我吃吃吃
🦪 牡蛎哟牡蛎
🈁 ko↓ko↑
🤔 嗯?
🤤 发癫
🥺 求你了
😡
耶!
🦸 你是英雄
🍾 开香槟咯
🌿
送出该表情需要消耗 20 积分