Paste #129274: rift.dsc 1.2

Date: 2024/12/23 11:54:11 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


rift:
    type: task
    definitions: loc|dur|color|points|rays|maxRotate|maxSize
    data:
        # Если вы хотите создать разлом через другой скрипт или командой, используйте: "- run rift def.loc:<> def.dur:<> def.color:<> def.points:<> def.rays:<> def.maxRotate:<> def.maxSize:<>" без патча!
        # Значение ниже - стоят по умолчанию. Если вы хотите оставить всё как есть, используйте: "- run rift def.loc:<>" (То есть укажите только локацию)
        #
        # color - Цвет середины разлома. Настраиваеться в def.color!
        # dur - Продолжительность существования разлома (В тиках). Настраиваеться в def.dur!
        # points - Количество точек в ветви разлома. Настраиваеться в def.points!
        # rays - Количество ветвей в разломе. Настраиваться в def.rays!
        # maxRotate - Максимальное отклонение луча от изначальной точки.
        # maxSize - Максимальный размер партилка (Больше трёх не работает).
        color: "#b71cff"
        dur: 200
        points: 15
        rays: 10
        maxRotate: 60
        maxSize: 1.8
    script:
        - define data <script.data_key[data]>
        - define atPlayer <player.location>
        - repeat <[rays]||<[data].get[rays]>>:
            - run rift def.loc:<[loc].center.random_offset[0.05]||<[atPlayer].center.random_offset[0.05]>> def.dur:<[dur]||<[data].get[dur]>> def.color:<[color]||<[data].get[color]>> def.points:<[points]||<[data].get[points]>> def.maxRotate:<[maxRotate]||<[data].get[maxRotate]>> def.maxSize:<[maxSize]||<[data].get[maxSize]>> path:spawn
    spawn:
        - define firstLoc <[loc].with_pitch[<[loc].center.face[<[loc]>].pitch>].with_yaw[<[loc].center.face[<[loc]>].yaw>]>
        - define oldLoc <[firstLoc]>
        - repeat <[points]>:
            - define point <[oldLoc].forward[0.3]>
            - define listPoint:->:<[point]>
            - definemap context:
                rotate: <util.random.decimal[90].to[1]>
                pitch: <[point].pitch.add[<util.random.decimal[-<[context.rotate]>].to[<[context.rotate]>]>].max[<[firstLoc].pitch.sub[<[maxRotate]>]>].min[<[firstLoc].pitch.add[<[maxRotate]>]>]>
                yaw: <[point].yaw.add[<util.random.decimal[-<[context.rotate]>].to[<[context.rotate]>]>].max[<[firstLoc].yaw.sub[<[maxRotate]>]>].min[<[firstLoc].yaw.add[<[maxRotate]>]>]>
            - define oldLoc <[point].with_pitch[<[context.pitch]>].with_yaw[<[context.yaw]>]>
        - repeat <[dur]>:
            - playsound <[loc].center> sound:block_conduit_attack_target volume:0.2 pitch:0.01 if:<util.random_chance[6]>
            - foreach <[listPoint].reverse> as:pointLoc:
                - playeffect at:<[pointLoc]> effect:dust special_data:<element[<[maxSize]>].div[<[listPoint].size>].mul[<[loop_index]>].add[0.2]>|<&color[<color[<[color]>].with_saturation[<[loop_index].mul[<element[170].div[<[points]>]>].round.min[255]>]>]> offset:0 visibility:1000
            - wait 1t