用户:
韵律源点Arcaea查看:19 回复:38 评论:19 创建时间:2020-05-24T10:26:51
自己看吧,有注释(PS:我为了你们还辛辛苦苦写注释快夸我
)
//by凌_墨水:我觉着吧,地图本身是做得很好,建筑物整齐有序,就是共人娱乐的东西还要增加,或者一些用代码制作的高科技。还有就是,要让整个地图体现五光十色这个标题,而不是单一的花花绿绿,这样能让地图更加生动
//bysplendid代码岛3加油: 额...我无话可说
//byCES_HIMkythen:我辛辛苦苦重新写的注释就认真看一下吧qaq
var hit = 10;
var tai = 0;
var can_use_sword = []
var can_use_weapon = []
var ban_user_names = ['你好2050','你好2060','你好2070'];
world.onPlayerJoin(({ entity }) => {
entity.enableDamage = true;
entity.player.scale = 0.91;
world.say(entity.player.name+"Think he will have a fresh time.\n("+entity.player.name+"觉得自己可能要度过一段新潮时光)")
if(entity.player.name=='吉吉喵'){
world.say("热烈欢迎吉吉喵!吉吉喵NB!")
entity.player.directMessage("恭喜成为管喵!管喵函数有:\nfly:飞行\n发光:发光\nresall:强制重生所有玩家\n添加管喵:添加另一位管喵,添加管喵+玩家名\n击杀:击杀某人,击杀+玩家名")
entity.player.directMessage("监狱:囚禁一位玩家,监狱+玩家名\n释放:将玩家从监狱中解放\n没在监狱时可视为单独重置重生点\n刷屏:清除聊天记录\n开启pvp:设置可喵\n关闭pvp:设置不可喵")
}
entity.player.onPress(({ button, raycast:{ hitEntity, direction } }) => {
if (button !== 'action0' || !hitEntity) {
return;
}
if (can_use_sword.indexOf(entity.player.name)!=-1){//这就是使用圣剑的伤害
hitEntity.hurt(1000, {
attacker: entity,
});
}
else if(can_use_weapon.indexOf(entity.player.name)!=-1){//使用武器的伤害
sleep(1000).then(()=>{
hitEntity.hurt(Math.random() * 150,{
attacker: entity,
});
})
}
hitEntity.hurt(hit, {
attacker: entity,
});
});
});
//下面是我写ban的失败尝试,不要用
world.onPlayerJoin(({entity}) => {
if(entity.player.name in ban_user_names){
e.player.directMessage("您已被封禁!")
ban_user_names.push(e.player.name)
for(i = 0;i < 100000;i++){
e.position.set(71,128,70)
}
}
});
world.onDie(({ entity, attacker }) => {
if (attacker) {
world.say(attacker.player.name + ' 击杀 ' + entity.player.name)
}
if(tai = 0){
sleep(100).then(()=>{
entity.player.forceRespawn();
})
}
else if(tai = 1){
sleep(10000).then(()=>{
entity.player.forceRespawn();
})
}
});
world.querySelectorAll('.火').forEach((e)=>{
e.onEntityContact(({other})=>{
sleep(500).then(()=>{
world.say(other.player.name+'被烧喵了');
other.hp=0;
})
})
})
world.querySelectorAll('.sans').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("嘿"+other.player.name+',想要来点番茄酱吗?');
})
})
world.querySelectorAll('.回血').forEach((c)=>{
c.onEntityContact(({other})=>{
sleep(500).then(()=>{
world.say(other.player.name+'血回满了!!!')
other.hp=100;
})
})
})
world.querySelectorAll('.小天使').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("捏嘿嘿,"+other.player.name+'!想要吃点喵面吗?!');
})
})
world.querySelectorAll('.抬棺炮hhhc').forEach((e)=>{
e.onEntityContact(({other})=>{
other.hurt(100);
world.say("BOOM!")
})
})
world.querySelectorAll('.huanyuan').forEach((e)=>{
e.onEntityContact(({other})=>{
other.hurt(100);
world.say("BOOM!")
})
})
world.querySelectorAll('.舰长').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("“Creeper”号!前进四!");//灵感来源:我的三体
})
})
world.querySelectorAll('.国旗').forEach((e)=>{
e.onEntityContact(({other})=>{
world.say("中国NB!!!!!!!!!!!!!!!!");
})
})
world.querySelectorAll('.彩蛋1').forEach((e)=>{
e.onEntityContact(({other})=>{
for (i = 0; i < 10; i++) { //灵感来源于help_tale
other.player.directMessage("H3LPHEIPHe1PLELPH3LPHEIPHe1PLELPH3LPHEIPHe1PLELPH3LPHEIPHe1PLELPH3LPHEIPHe1PLELPH3LPHEIPHe1PLELP");
}
})
})
world.querySelectorAll('.papyrus的床').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage(other.player.name+',这是我的床,\n我经常开着它出去玩呢!捏嘿嘿!\n话说,sans那个懒骨头去哪了?!\n他肯定又去酒吧了!');
})
})
world.querySelectorAll('.喵面').forEach((e)=>{
e.onEntityContact(({other})=>{
sleep(3000).then(()=>{
world.say(other.player.name+'因为某种不知名原因喵了……');
other.hp=0;//一个著名的梗2333
})
})
})
world.onPlayerJoin(({entity})=>{
entity.position.set(87, 12, 70);//玩家进来的时候,将ta传送到指定的坐标
entity.player.spawnPoint.copy(entity.position);//将玩家复活点复制为上面的坐标
})
world.querySelectorAll('.小幽灵').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("你好……"+other.player.name+'……想听我唱首歌吗……');
})
})
world.querySelectorAll('.专业团队').forEach((e)=>{
e.onEntityContact(({other})=>{
other.position.set(40, 14, 101);
world.say(other.player.name+"被抬了!");//懂的自然懂(狗头)
other.hp=0;
tai = 1;
sleep(10000).then(()=>{
other.player.forceRespawn();
tai = 0;
})
})
})
world.querySelectorAll('.隐藏剧情1').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("解锁隐藏剧情:\n你从这个人口中了解到,他丢失了一副眼镜,你能帮他找回来吗?");
})
})
world.querySelectorAll('.哼~').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("你好!哼~");
other.player.scale=0.3;
})
})
world.querySelectorAll('.武器').forEach((e)=>{
e.onEntityContact(({other})=>{
world.say(other.player.name+"拿到了武器!");
can_use_weapon.push(other.player.name)//添加玩家名字进入可使用武器名单
})
})
world.querySelectorAll('.神圣之光剑').forEach((e)=>{
e.onEntityContact(({other})=>{
world.say(other.player.name+"拿到了神圣之光剑啊!");
can_use_sword.push(other.player.name)//添加玩家名字进入可使用圣剑名单
})
})
world.querySelectorAll('.丢失的眼镜').forEach((e)=>{
e.onEntityContact(({other})=>{
other.hp=Math.random() * 500;//也是一个随机数,但这个不需要转变为整数
other.player.runSpeed=1.2;
other.player.directMessage("恭喜找到了眼镜,获得额外生命值?点+速度增加");
})
})
world.querySelectorAll('.跳跃').forEach((e)=>{
e.onEntityContact(({other})=>{
other.velocity.y+=2;
other.player.directMessage("wryyyyyyyyyyyy!");
})
})
world.querySelectorAll('.跳跃力度4').forEach((e)=>{
e.onEntityContact(({other})=>{
other.velocity.y+=2.5;
other.player.directMessage("wryyyyyyyyyyyy!");
})
})
world.querySelectorAll('.跳跃x1.5').forEach((e)=>{
e.onEntityContact(({other})=>{
other.velocity.y+=1;
other.player.directMessage("wryyyyyyyyyyyy!");
})
})
world.querySelectorAll('.一个高处的大炮').forEach((e)=>{
e.onEntityContact(({other})=>{
other.velocity.z+=4;
other.velocity.y+=2;
other.player.directMessage("BOOM!");
})
})
world.querySelectorAll('.对撞机-x加').forEach((e)=>{
e.onEntityContact(({other})=>{
other.velocity.x-=1.5;
})
})
world.querySelectorAll('.对撞机-x减').forEach((e)=>{
e.onEntityContact(({other})=>{
other.velocity.x+=1.5;
})
})
var start=false;
world.onVoxelContact(({ voxel, x, y, z , entity}) => {
const c = voxels.id('O');
if(voxel==c&&start==false){
world.say(entity.player.name+"充满fresh的出发了!YOLO!")
start=true;
entity.player.canFly = false;
entity.player.scale = 1;
entity.player.invisible = false;
entity.player.runSpeed = 0.5;
entity.player.jumpPower=1;
entity.player.spawnPoint.copy(entity.position);
}
const s = voxels.id('S');
if (voxel===s&&start===true){
entity.player.spawnPoint.copy(entity.position);
entity.player.directMessage('恭喜你存档成功!祝你好运!YOLO!');
};
world.onFluidEnter(({entity , voxel}) => {
if (entity.isPlayer===true&&start===true){
const p = voxels.id('blueberry_juice');
if (voxel===p){entity.player.forceRespawn()}
}
});
});
world.querySelectorAll('.隐形').forEach((e)=>{e.meshInvisible=true})
world.querySelectorAll('.B').forEach((e)=>{
e.onEntityContact(({other})=>{
other.position.x=98;
other.position.z=52;
other.player.directMessage("木大!");
})
})
world.querySelectorAll('.A').forEach((e)=>{
e.onEntityContact(({other})=>{
other.position.x=57;
other.position.z=13;//这是我还不会用position.set时写的
other.player.directMessage("欧拉!");
})
})
world.querySelectorAll('.酒吧存档点').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("看着面前这热闹的酒吧……");
sleep(1000).then(()=>{
other.player.directMessage('你充满了决心。');
other.player.spawnPoint.copy(other.position);
sleep(500).then(()=>{
other.player.directMessage("存档点-酒吧 已保存");
})
})
})
})
world.querySelectorAll('.大楼存档点').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("看着面前这高耸的大楼……");
sleep(1000).then(()=>{
other.player.directMessage('你充满了决心。');
other.player.spawnPoint.copy(other.position);//其实存档就这一句233
sleep(500).then(()=>{
other.player.directMessage("存档点-大楼 已保存");
})
})
})
})
world.querySelectorAll('.奇怪的地方存档点').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("在这样一座炫酷的城市里,\n看见这样一片素净之地,\n还有一个奇怪的雕塑……");
sleep(1000).then(()=>{
other.player.directMessage('这使你充满了决心。');
other.player.spawnPoint.copy(other.position);
sleep(500).then(()=>{
other.player.directMessage("存档点-奇怪的地方 已保存");
})
})
})
})
world.querySelectorAll('.提米').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("你吼!\n欢迎光银...提米百嚯店!");
})
})
world.querySelectorAll('.传送点').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.forceRespawn()
other.player.directMessage("回档成功!");
})
})
world.querySelectorAll('.终点').forEach((e)=>{
e.onEntityContact(({other})=>{
//一堆的作弊判断
if(other.player.canFly=true){
world.say("请勿作弊~")
}
else if(other.player.invisible=true){
world.say("请勿作弊~")
}
else if(other.player.jumpPower=2.5){
world.say("请勿作弊~")
}
else{
other.player.canFly=true;
other.player.invisible=true;
world.say("恭喜"+other.player.name+"完成了跑酷,获得隐身和飞行奖励");
start=false;
}
})
})
var op_names = ['CES_HIMkythen','BZS编程球球','splendid代码岛3加油','吉吉喵']
//下面这一大段我不知道怎么讲 你们就自行理解吧
world.onChat(({entity,message})=>{
if(!(entity&&entity.isPlayer)){return};
if(message=='我在这里!'){entity.say('我在'+'x:'+entity.position.x+' '+'y:'+entity.position.y+' '+'z:'+entity.position.z+' 快来见我!');}
if(message=='退出跑酷'){start=false}
if(message=='退出迷宫'){mg_start=false}
if(op_names.indexOf(entity.player.name)!=-1){
if(message=='resall'){
world.querySelectorAll('player').forEach((x) => x.player.forceRespawn())}
else if(message=='fly'){
entity.player.canFly=!entity.player.canFly;
}
else if(message=='发光'){entity.player.emissive += 1}else if(message=='//emi'){entity.player.emissive-=1;}
else if(message=='pvp'){world.PVP=!world.PVP};
world.querySelectorAll("player").forEach((e)=>{
if(message.slice(0,5)=='添加管喵'){
if(message.slice(5,message.length)==e.player.name){
op_names.push(e.player.name)
world.say(e.player.name+"被添加进管喵名单!")
e.player.directMessage("恭喜成为管喵!管喵函数有:\nfly:飞行\n发光:发光\nresall:强制重生所有玩家\n添加管喵:添加另一位管喵,添加管喵+玩家名\n击杀:击杀某人,击杀+玩家名")
e.player.directMessage("监狱:囚禁一位玩家,监狱+玩家名\n释放:将玩家从监狱中解放\n没在监狱时可视为单独重置重生点\n刷屏:清除聊天记录\nhelp:再次查看帮助\n开启pvp:设置可喵\n关闭pvp:设置不可喵")
}
}
});
if(message=='help'){
entity.player.directMessage("管喵函数有:\nfly:飞行\n发光:发光\nresall:强制重生所有玩家\n添加管喵:添加另一位管喵,添加管喵+玩家名\n击杀:击杀某人,击杀+玩家名")
entity.player.directMessage("监狱:囚禁一位玩家,监狱+玩家名\n释放:将玩家从监狱中解放\n没在监狱时可视为单独重置重生点\n刷屏:清除聊天记录\nhelp:再次查看帮助\n开启pvp:设置可喵\n关闭pvp:设置不可喵")
}
if(message=='开启pvp'){
world.querySelectorAll("player").forEach((e)=>{
e.enableDamage = true;
});
entity.player.directMessage("pvp已开启!");
}
if(message=='关闭pvp'){
world.querySelectorAll("player").forEach((e)=>{
e.enableDamage = false;
});
entity.player.directMessage("pvp已关闭!");
}
if(message=='inv'){entity.player.invisible!=entity.player.invisible}
};
});
world.querySelectorAll('.火箭').forEach((e)=>{
e.onClick(({clicker})=>{
e.velocity.y+=6;
world.say(clicker.player.name+" 发射了火箭")
clicker.player.directMessage("发射成功!");
sleep(5000).then(()=>{
e.position.y=42.96;//拉回来
e.velocity.y=0;//加速度调成0,不然会一直飞
world.say("火箭已复位!")
})
})
})
world.querySelectorAll('.上天按钮').forEach((e)=>{
e.onClick(({clicker})=>{
clicker.velocity.y+=3;
world.say(clicker.player.name+"进入了PVP场地!");
clicker.enableDamage=true;
clicker.player.cameraMode = 'fps';//这个更新暂时没有加进去
})
})
var mg_start=false;
world.onVoxelContact(({ voxel, x, y, z , entity}) => {
const c = voxels.id('M');
if(voxel==c&&mg_start==false){//检测方块
world.say(entity.player.name+"闯入了迷宫!")
//各项数值初始化
mg_start=true;
entity.player.canFly = false;
entity.player.scale = 1;
entity.player.invisible = false;
entity.player.runSpeed = 0.5;
entity.player.spawnPoint.copy(entity.position);
}
});
world.querySelectorAll('.迷宫终点').forEach((e)=>{
e.onEntityContact(({other})=>{
if(mg_start==true){
other.player.jumpPower=2.5;
world.say("恭喜"+other.player.name+"完成了迷宫,跳跃上升了!");
mg_start=false;
}
else{
world.say("请勿作弊~")
}
});
})
world.querySelectorAll('.大炮').forEach((e)=>{
e.onEntityContact(({other})=>{
other.velocity.y+=1.5;
other.velocity.x+=6.5;//加速度
world.say(other.player.name+"发射了自己!");
})
})
world.querySelectorAll('.CES_HIMkythen').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("我 关 我 自 己(PS:HIM,Notch等3人觉得很喵,吉良吉影觉得很赞)")
})
})
/*world.querySelectorAll('.一个彩蛋……算是吧').forEach((e)=>{
e.onEntityContact(({other})=>{
world.say("恭喜"+other.player.name+"找到了最终彩蛋\n请加作者qq2019178611并附上截图")
sleep(1000).then(()=>{
world.say("接下来我要跟你们说说我对编程猫的真实感受……")
sleep(1000).then(()=>{
world.say("我从2015年开始接触编程猫")
sleep(1000).then(()=>{
world.say("我一开始的时候,其实是很懵的")
sleep(1000).then(()=>{
world.say("然后我……遇到了几个“老朋友”。")
sleep(1000).then(()=>{
world.say("其实就是假编啊,假猫啊,鱼头啊还有糖醋等")
sleep(1000).then(()=>{
world.say("还有当时成立的“萌新院”\n杰鸽和副本我一直都没忘……")
sleep(1000).then(()=>{
world.say("其实啊\n当工作室最初出来时我是很不屑的")
sleep(1000).then(()=>{
world.say("我认为我是个大佬\n不需要加入任何工作室")
sleep(1000).then(()=>{
world.say("呵呵……很蠢,不是吗?")
sleep(1000).then(()=>{
world.say("但在看到ZCH,跃动,幻想等工作室后\n我就完全不那么想了……")
sleep(1000).then(()=>{
world.say("所以……我第一次真正意识到我的不足")
sleep(1000).then(()=>{
world.say("我第一次意识到我需要改变")
sleep(1000).then(()=>{
world.say("后来,江湖派出现了")
sleep(1000).then(()=>{
world.say("我也是第一次感受到\n一个不守规矩的人可以造成如此大的影响\n不管你们承不承认\n这次江湖派的影响是很大的")
sleep(1000).then(()=>{
world.say("好的我的话说完了,你们游玩愉快!YOLO!")
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})
})*/
//这个彩蛋也就算是公开了吧2333
world.querySelectorAll('.一朵小fa').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("Howdy!I'm Flowey!Flowey called flower!");
})
})
world.querySelectorAll('.幸运方块').forEach((e)=>{
e.onEntityContact(({other})=>{
world.say(other.player.name+"触碰了幸运方块!");
sleep(500).then(()=>{
if(Math.round(Math.random()*2)==0){//随机数要记得加上round
world.say("结果是什么呢?!");
other.hp=0;
world.say(other.player.name+"喵了……");
}
if(Math.round(Math.random()*100)==1){
world.say("结果是什么呢?!");
other.player.canFly=true;
world.say("我的天哪!"+other.player.name+"居然能飞了!");
}
if(Math.round(Math.random()*100)==2){
world.say("结果是什么呢?!");
other.player.invisible=true;
world.say("OMG!"+other.player.name+"隐身了!");
}
if(Math.round(Math.random()*4)==3){
world.say("结果是什么呢?!");
other.player.swimSpeed=2;
world.say(other.player.name+"获得了2的游泳速度!");
}
})
sleep(3000).then(()=>{
//233333 没有卵用的一个等待
})
})
})
world.querySelectorAll('.233?').forEach((e)=>{
e.onEntityContact(({other})=>{
other.player.directMessage("欢迎,"+other.player.name+"!下方就是大型离子对撞器了!(可用于挂机)")
})
})
world.onChat(({entity,message,})=>{
if(op_names.indexOf(entity.player.name)!=-1){//判断是否为op
world.querySelectorAll("player").forEach((e)=>{
if(message.slice(0,2)=='击杀'){//判断消息内容
if(message.slice(2,message.length)==e.player.name){
e.hurt(10000)
world.say(e.player.name+"被击杀了")
}
}
});
}
})
world.onChat(({entity,message,})=>{
if(op_names.indexOf(entity.player.name)!=-1){//判断是否为op
world.querySelectorAll("player").forEach((e)=>{
if(message.slice(0,2)=='监狱'){//判断消息内容
if(message.slice(2,message.length)==e.player.name){
e.position.set(114,14,79)
if(op_names.indexOf(e.player.name)!=-1){//判断是否为op
e.player.forceRespawn()//释放
world.say(entity.player.name+"居然试图把管喵关起来!")//提示语
}
else{
world.say(e.player.name+"被关进了监狱!(代码来源:Lonely_wanderer)")
}
}
}
});
}
})
world.onChat(({entity,message,})=>{
if(op_names.indexOf(entity.player.name)!=-1){//判断是否为op
world.querySelectorAll("player").forEach((e)=>{
if(message.slice(0,2)=='释放'){//判断消息内容
if(message.slice(2,message.length)==e.player.name){
e.player.forceRespawn()
world.say(e.player.name+"被释放了!")
}
}
});
}
})
world.onChat(({entity,message,})=>{
if(op_names.indexOf(entity.player.name)!=-1){//判断是否为op
world.querySelectorAll("player").forEach((e)=>{
if(message=='刷屏'){//判断消息内容
world.say("*But nothing changed.");
sleep(1000).then(()=>{
for (i = 0; i < 10000; i++) { //for循环没啥好说的……
world.say("*Changed.");
}
})
}
});
}
})
/*world.querySelectorAll('.门').forEach((e)=>{//有标签“门”的
e.open=0//初始芝士
e.onClick(async({entity,utton,clicker})=>{//执行函数被点击效果
if(e.open==0){//假如初始芝士等于这么多
e.open=1//就那么多
for(i=0;i<2;i++){//喵钱的东西
e.position.z+=1}//揪过去
await sleep(2000)//休息一会(你难道把门拉开就关上吗!?)
for(i=0;i<2;i++){//喵钱的东西
e.position.z-=1}//再扒回来
e.open=0//回去辽
} //记得框架
})//还有我
})//带我一个*/
//这一段不知道是谁偷了墨水的代码别在意2333