Date: 2024/08/16 22:43:04 UTC-07:00
Type: Denizen Script
Runestone_Projectile_Task:
type: task
definitions: damage|projectile|color
script:
- define loc1 <player.eye_location.forward[1.5]>
- define loc2 <player.eye_location.forward[15]>
- if <[damage]||null> == null:
- define damage 1
- if <[projectile]||null> == null:
- define projectile air
- if <[color]||null> == null:
- define color white
- define color <&ns><script[Runestone_Particle_Colors].data_key[<[color]>]>
- spawn item_display[item=<[projectile]>;scale=0.5,0.5,0.5] <[loc1]> save:projectile_entity
- define projectile_entity <entry[projectile_entity].spawned_entity>
- adjust <[projectile_entity]> teleport_duration:2.75
- wait 2t
- teleport <[projectile_entity]> <[loc2]>
- define target_list <empty>
- foreach <[loc1].points_between[<[loc2]>].distance[0.5]> as:value:
- playeffect effect:dust special_data:2|<color[<[color]>]> at:<[value]> offset:0
- wait 2t
#- narrate <[projectile_entity].location>
- foreach <[value].find_entities.within[1].exclude[<player>|<[projectile_entity]>]> as:target:
- if <[target]> in <[target_list]>:
- foreach stop
#- narrate "found <[target].entity_type>"
- define target_list:->:<[target]>
- hurt <[damage]> <[target]>