Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #{_player}=攻撃者
- #{_radious}=最大射程
- #{_trueyaw}=yaw範囲
- #{_uppitch}=pitchの上の範囲
- #{_downpitch}=pitchの下の範囲
- #{_basedmg}基礎ダメージ
- #{_critdmg}=CritDmg
- #{_critmaxlength}=Crit最大射程
- #{_critminlength}=Crit最短射程
- #※ここでのCritは確率ではなく最もダメージが出せる距離でのダメージ補正
- #{_critsound}=Crit音
- #{_critpitchofs}=Crit音のPitch
- on right click with iron axe:
- atk(player ,6 ,20 ,7 ,25 ,12 ,8 ,5 ,4.5 ,"entity.player.attack.crit" ,2 ,6 ,crit ,1 ,5 ,2 ,0.3 ,"entity.player.attack.sweep" ,1 ,1 ,10)
- function atk(player:player ,radious:number ,trueyaw:number ,uppitch:number ,downpitch:number ,basedmg:number ,critdmg:number ,critmaxlength:number ,critminlength:number ,critsound:string ,critpitchofs:number ,CD:number ,partype:particle ,paramo:number ,parextra:number ,delay:number ,delayendoffrontpush:number ,sound:string ,soundpitch:number ,next:number ,nextwait:number):
- loop entities in radius {_radious} around {_player}:
- loop-entity is not {_player}
- living(loop-entity) is set
- set {_vec} to vector from {_player} to loop-entity
- set {_yaw} to yaw of {_vec}
- set {_pitch} to pitch of {_vec}
- set {_pitchup} to {_pitch} - {_uppitch}
- set {_pitchdown} to {_pitch} + {_downpitch}
- set {_pitchupnear} to {_pitch} - 60
- set {_pitchdownnear} to {_pitch} + 60
- set {_yawcheck} to yaw of {_player}
- set {_yawcheck} to {_yawcheck} - {_yaw}
- if {_yawcheck} < 0:
- set {_yawcheck} to {_yawcheck} * -1
- set {_lim} to 360 - {_trueyaw}
- if {_yawcheck} >= {_lim}:
- set {_yawcheck} to 360 - {_yawcheck}
- if distance between {_player} and loop-entity <= 2.5:
- if distance between {_player} and loop-entity <= 1.5:
- set {_pitchupnear} to {_pitch} - 90
- set {_pitchdownnear} to {_pitch} + 90
- pitch of {_player} is between {_pitchdownnear} and {_pitchupnear}
- {_yawcheck} is between 0 and 60
- set {_ok} to 1
- else:
- pitch of {_player} is between {_pitchdown} and {_pitchup}
- {_yawcheck} is between 0 and {_trueyaw}
- set {_ok} to 1
- {_ok} is set
- if distance between {_player} and loop-entity >= {_critminlength}:
- distance between {_player} and loop-entity <= {_critmaxlength}
- set {_ce} to 1
- if {_ce} is set:
- play sound "%{_critsound}%" with volume 1 and pitch {_critpitchofs} at {_player}
- make 20 of block particle using nether wart block at block 1 meters above loop-entity
- make {_player} damage loop-entity by ({_basedmg} + {_critdmg})
- else:
- make {_player} damage loop-entity by {_basedmg}
Advertisement
Add Comment
Please, Sign In to add comment