YesNoOk
avatar

Projectile Clone/Reflection Code Shiyo Kakuge (Read 35550 times)

Started by BurningSoul, September 10, 2023, 08:31:12 pm
Share this topic:
Projectile Clone/Reflection Code Shiyo Kakuge
#1  September 10, 2023, 08:31:12 pm
  • ****
  • Pixels are atom's of resolution,Low-res or Hi-res
    • Turkey
    • metekervan26@gmail.com
Code:
;==========================
;==========================
; Projctile [helper] ; ”ò‚Ñ“¹‹ï
; --- ---
; v00: proj alive flag
; --- ---
; v01: proj id (multi proj)
; v02: attack id (target,id)->(numtarget(v02))
; v04: proj remove_time
; v06: max_hits
; v07: hits_miss_time
; v08: damage_hit
; v09: damage_guard
; v10: hit fall
; v11: options_type
; 00:hado / 10:fire_hado / 11:blue_fire_hado / 20:air_hado(no_hit_crouch)
; 40:knife
; v12: counter/timer (can be reinited)
; v13: hit_anim_type
; animtype:: 0:light / 1:medium / 2:hard / 3:back / 4:up / 5:diag-up
; v14: remove_type
; --- ---
; v15-18: code_set: 10311+10212+10113=30636 (xxx)
; --- ---
; v19: hit self switch (E-F)
; v20: fall switch / last hit (->v10)
; v21-29: palfx RGB(R,G,B)
; v30: init flag / counter/timer (can be reinit)
; v31: reset flag
; --- ---
; v32: projtime from a to z (can NOT be reinited)
; v33: target id
; --- ---
; v34: hitsound (300,v34)
; v35: hitspark v35+(random%4)*10
; v36: palfx time (off:0)
; v37: CanGetHit Flag:: 0:Normal(default) / 1:CanGetHit
; --- ---
; v40: p2dist x (width)
; v41: p2dist x _level
; --- ---
; f00-01: speed_x/y (1/1000)
; f02-03: xxx
; f04-05: sparkxy
; f06-07: hit_velocity_x/y (1/10)
; f08-09: guard_velocity_x/y (1/10)
; f10-11: option_veladd_x/y [def:0]
; f12-13: option_flag_bound [def:0]
; --- ---
;==========================
[statedef 91000]
type=a
movetype=a
physics=n
anim=const(size.head.pos.x)
sprpriority=5
;-; ownpal=1
poweradd=0
velset=0,0
ctrl=0
;---
;;[state 0] ;[.00a0] ; code_set
;; type=varset
;; trigger1=!var(32)
;; var(18)=(var(15):=10311)+(var(16):=10212)+(var(17):=10113) ; ###
;---
[state 0] ;[.00a1]
type=assertspecial
trigger1=1
flag=invisible
;op; flag2=noshadow
ignorehitpause=1
[state 0] ;[.00a2]
type=nothitby
trigger1=1
value=sca
ignorehitpause=1
;---
; affectteam_reset
[state 0] ;[.05a]
type=turn
trigger1=var(31)
ignorehitpause=1
[state 0] ;[.05b]
type=varset
trigger1=var(31)
var(19)=!var(19) ;; E -> F
ignorehitpause=1
;---
[state 0] ;[.06a]
type=modifyexplod
trigger1=var(31)
id=1
scale=ifelse(var(19),-1,1)*const(size.xscale)
trans=sub ;;**
ignorehitpause=1
[state 0] ;[.06b]
type=modifyexplod
trigger1=var(31)
id=2
scale=ifelse(var(19),-1,1)*const(size.xscale)
ignorehitpause=1
;---
; re_init
[state 0] ;[.07a1]
type=varset
trigger1=var(31)
var(31)=0  +( var(30):=0 ) ;;<- re_init
ignorehitpause=1
;--- {init.start}
;; all_helper_id (attack_id -> target,id)
;; 1000: special proj / 3000: hyper/super_proj
[state 0] ;[.07a2]
type=varset
trigger1=!var(32) ;;<-only_once
var(2)=ishelper(1000)*1000+ishelper(3000)*3000
ignorehitpause=1
;---
[state 0] ;[.10c1]
type=null
trigger1=!var(30)
trigger1=1|| var(1):=ifelse(ishelper(3000),60000,10000)+(gametime%40000)
;//; * use "gametime" to avoid ID dublication (id range [10000-60000])
;//; * ID‚ğd•¡‚³‚¹‚È‚¢ˆ×‚É"gametime"‚ğŽg‚¢‚Ü‚·
trigger1=1|| var(4):=ifelse((const(size.height)%1000)<1,1,const(size.height)%1000) ;;<- remove_time
trigger1=1|| fvar(0):=const(size.mid.pos.x)/1000.000 || fvar(1):=const(size.mid.pos.y)/1000.000 ;;<- speed_x / y
trigger1=1|| fvar(6):=-(((const(size.air.front)/1000)%1000)-500)/10.0 || fvar(7):=-((const(size.air.front)%1000)-500)/10.0  ;;<- vel_xy_hit
trigger1=1|| fvar(8):=-(((const(size.air.back)/1000)%1000)-500)/10.0  || fvar(9):=-((const(size.air.back)%1000)-500)/10.0   ;;<- vel_xy_guard
trigger1=1|| var(6):=const(size.ground.front)/1000 || var(7):=const(size.ground.front)%1000 ;;<- max_hits / hittime
trigger1=1|| var(8):=const(size.ground.back)/10000 || var(9):=const(size.ground.back)%10000 ;;<- damage_hit / damage_guard
trigger1=1|| var(10):=const(size.shadowoffset) ;;<- fall_ground
trigger1=1|| var(11):=(const(size.height)/1000)%100 ;;<- options_type
;//; 00:hado / 10:fire_hado / 11:blue_fire_hado / 20:air_hado(no_hit_crouch)
;//: 40:knife
trigger1=1|| var(12):=0 ;;<- counter/timer reset
trigger1=1|| var(13):=(const(size.height)/100000)%10 ;;<- hit_anim_type
;//; animtype:: 0:light / 1:medium / 2:hard / 3:back / 4:up / 5:diag-up
trigger1=1|| var(14):=(const(size.height)/1000000)%10 ;;<- remove_type
trigger1=1|| var(37):=(const(size.height)/10000000)%10 ;;<- cangethit_flag
;;//; cangethit flag:: 0:normal / 1:cangethit
trigger1=1|| var(34):= (var(11)=[10,12])*20 +(var(11)=40)*41 +(var(11)=13)*50 || var(34):=ifelse(var(34),var(34),30) ;;<-hitsound / default
trigger1=1|| var(35):=((var(2)>=1000)+(var(2)>=3000)+2) +(var(11)=40)*5 ;;<-hitspark ;;normal{0-2/s3/h4] /sharp{+5}
ignorehitpause=1
;---
[state 0] ;[.10c2] ; damage_revise
type=null
trigger1=!var(30) && numenemy && root,sysfvar(0)>0 && playeridexist(floor(root,sysfvar(0))) && enemy,sysfvar(0)>0 && playeridexist(floor(enemy,sysfvar(0)))
trigger1=playerid(floor(root,sysfvar(0))),var(0)=90900 && playerid(floor(root,sysfvar(0))),!AILevel && playerid(floor(enemy,sysfvar(0))),var(0)=90900 && playerid(floor(enemy,sysfvar(0))),AILevel
trigger1=1|| var(8):=floor(var(8)/((roundno*0.5+matchno*0.5+ (playerid(floor(enemy,sysfvar(0))),var(51)) )*0.1+0.7))
trigger1=1|| var(9):=floor(var(9)/((roundno*0.5+matchno*0.5+ (playerid(floor(enemy,sysfvar(0))),var(51)) )*0.1+0.7))
;--- {init.end}
;---
; countter / ticks_elapsed
; ”­ŽËŒãŽžŠÔŒo‰ß(ƒJƒEƒ“ƒgƒ_ƒEƒ“)
[state 0] ;[.12a2]
type=varadd
trigger1=hitpausetime<1
var(12)=1 ;; (only once)
ignorehitpause=1
[state 0] ;[.12a3]
type=varadd
trigger1=1
var(30)=1 ;; (reinit flag)
ignorehitpause=1
;---
[state 0] ;[.13b1] ; fx_mask
type=palfx
trigger1=1
time=1
add=0,0,0
mul=384,384,384
color=0
ignorehitpause=1
[state 0] ;[.13b5] ; mask/sub
type=explod
trigger1=!time && !numexplod(1)
anim=anim
id=1
postype=p1
sprpriority=5
ownpal=0 ;;**
bindtime=-1
removetime=-1
scale=const(size.xscale),const(size.yscale)
trans=sub
ignorehitpause=1
[state 0] ;[.13b6] ; dxor
type=explod
trigger1=!time && !numexplod(2)
anim=anim
id=2
postype=p1
sprpriority=6
ownpal=1 ;;**
bindtime=-1
removetime=-1
scale=const(size.xscale),const(size.yscale)
ignorehitpause=1
;---
;---
; fall_switch ; “|‚êƒXƒCƒbƒ`
[state 0] ;[.15a]
type=varset
trigger1=(var(3)+1>=var(6))&&((var(10)%10=1)||(var(10)%10>2))
var(20)=1
ignorehitpause=1
; pal_eff ; ƒpƒŒƒbƒgŒø‰Ê
[state 0] ;[.15b]
type=null
triggerall=var(30)<2
triggerall=1|| (var(21):=500500500)||(var(22):=var(21))||(var(23):=var(21)) ;;default
;; v21-23:add/mul/sin(RRRGGGBBB-500500500), v24:time(AAATTT)
trigger1=var(11)=10 ;;<-Fire_Red (208,0,-208)(255,200,200),(255,196,196,20),(18+)
trigger1=1|| (var(21):=708500292)||(var(22):=755700700)||(var(23):=755696696) || var(24):=20018+var(7)
trigger2=var(11)=11 ;;<-Fire_Blue (48,0,168)(196,196,255),(168,128,255,20),(18+)
trigger2=1|| (var(21):=548500668)||(var(22):=696696755)||(var(23):=668628755) || var(24):=20018+var(7)
trigger3=var(11)=13 ;;<-Ice  (0,196,255)(200,255,255),(32,64,96,15),(16+)
trigger3=1|| (var(21):=500696755)||(var(22):=700755755)||(var(23):=532564596) || var(24):=15016+var(7)
trigger4=var(11)=14 ;;<-Electr (128,128,128)(200,200,200),(-128,-128,-128,10),(16+)
trigger4=1|| (var(21):=628628628)||(var(22):=700700700)||(var(23):=372372372) || var(24):=10016+var(7)
;---
;---
; CanGetHit_Type:: 0:Normal
[state 0] ;[.16a]
type=hitby
trigger1=!var(0) && var(12)>1 ;;<- Changable_Timer
value=sca,np,sp,hp
ignorehitpause=1
; CanGetHit_Type:: 1:CanGetHit
[state 0] ;[.16b]
type=hitby
trigger1=!var(0) && var(12)>1 ;;<- Changable_Timer
trigger1=var(37)=1 ;;CanGetHit
value=sca,na,sa,ha,np,sp,hp
ignorehitpause=1
; for_Reflection
[state 0] ;[.16e]
type=nothitby
trigger1=var(19)=1 ;;<- for_Reflection
value=sca
ignorehitpause=1
;---
[state 0] ;[.18a] ; Normal
type=hitoverride
trigger1=!var(0) && var(12)>1 ;;<- Changable_Timer
attr=sca,np,sp,hp
stateno=stateno
ignorehitpause=1
[state 0] ;[.18b] ; CanGetHit
type=hitoverride
trigger1=!var(0) && var(37)=1 && var(12)>1 ;;<- Changable_Timer
attr=sca,na,sa,ha,np,sp,hp
stateno=stateno
ignorehitpause=1

;---
;---; v11:hittype / v13:animtype=sca / v19:affectteam=e
[state 0] ;[.20a1]
type=hitdef
trigger1=!var(0) && var(11)!=20 && var(13)=0 && var(19)=0
attr=a,sp
affectteam=e ; -> f
id=var(2)
damage=var(8),var(9)
animtype=heavy
air.animtype=back
fall.animtype=back
ground.type=high
air.type=low
hitflag=mhaf ; mhafp ;; <- hit_all
guardflag=ma
hitsound=-1
guardsound=41,0
pausetime=var(7),var(7)+1
sparkno=-1
guard.sparkno=-1
sparkxy=0,0
ground.slidetime=var(7)+12
ground.hittime=  var(7)+12
air.hittime=     var(7)+12
ground.velocity=   fvar(6)*ifelse(var(20),0.5,1), fvar(7)*var(20)
guard.velocity=    fvar(8)
air.velocity=      fvar(6)*0.5, fvar(7)
airguard.velocity= fvar(8)*0.5, fvar(9)
yaccel=0.5
fall=var(20)
air.fall=(var(10)%10>=2)
fall.recover=((var(10)/10)%10=0)
;op; fall.recovertime=18
air.juggle=(!var(3))*const(data.airjuggle)
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
;op; envshake.time=0
;op; envshake.ampl=0
guard.ctrltime=0
guard.dist=32
fall.envshake.time=id
fall.envshake.ampl=0
palfx.time=  var(24)%1000
palfx.add=   ((var(21)/1000000)%1000-500),((var(21)/1000)%1000-500),(var(21)%1000-500)
palfx.mul=   ((var(22)/1000000)%1000-500),((var(22)/1000)%1000-500),(var(22)%1000-500)
palfx.sinadd=((var(23)/1000000)%1000-500),((var(23)/1000)%1000-500),(var(23)%1000-500),(var(24)/1000)%1000
palfx.color=0
palfx.invertall=1
;---; v11:hittype / v13:animtype=sca / v19:affectteam=f
[state 0] ;[.20a2]
type=hitdef
trigger1=!var(0) && var(11)!=20 && var(13)=0 && var(19)=1
attr=a,sp
affectteam=f ; -> e
id=var(2)
damage=var(8),var(9)
animtype=heavy
air.animtype=back
fall.animtype=back
ground.type=high
air.type=low
hitflag=mhaf ; mhafp ; <- hit_all
guardflag=ma
hitsound=-1
guardsound=41,0
pausetime=var(7),var(7)+1
sparkno=-1
guard.sparkno=-1
sparkxy=0,0
ground.slidetime=var(7)+12
ground.hittime=  var(7)+12
air.hittime=     var(7)+12
ground.velocity=   fvar(6)*ifelse(var(20),0.5,1), fvar(7)*var(20)
guard.velocity=    fvar(8)
air.velocity=      fvar(6)*0.5, fvar(7)
airguard.velocity= fvar(8)*0.5, fvar(9)
yaccel=0.5
fall=var(20)
air.fall=(var(10)%10>=2)
fall.recover=((var(10)/10)%10=0)
air.juggle=(!var(3))*const(data.airjuggle)
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.ctrltime=0
guard.dist=32
fall.envshake.time=id
fall.envshake.ampl=0
palfx.time=  var(24)%1000
palfx.add=   ((var(21)/1000000)%1000-500),((var(21)/1000)%1000-500),(var(21)%1000-500)
palfx.mul=   ((var(22)/1000000)%1000-500),((var(22)/1000)%1000-500),(var(22)%1000-500)
palfx.sinadd=((var(23)/1000000)%1000-500),((var(23)/1000)%1000-500),(var(23)%1000-500),(var(24)/1000)%1000
palfx.color=0
palfx.invertall=1
;--- ---
;---; v11:hittype_c / v13:animtype / v19:affectteam=e
[state 0] ;[.20b1]
type=hitdef
trigger1=!var(0) && var(11)=20 && var(13)=0 && var(19)=0
attr=a,sp
affectteam=e
id=var(2)
damage=var(8),var(9)
animtype=heavy
air.animtype=back
fall.animtype=back
ground.type=high
air.type=low
hitflag=haf ; hafp ; <- not_hit_crouching
guardflag=ma
hitsound=-1
guardsound=41,0
pausetime=var(7),var(7)+1
sparkno=-1
guard.sparkno=-1
sparkxy=0,0
ground.slidetime=var(7)+12
ground.hittime=  var(7)+12
air.hittime=     var(7)+12
ground.velocity=   fvar(6)*ifelse(var(20),0.5,1), fvar(7)*var(20)
guard.velocity=    fvar(8)
air.velocity=      fvar(6)*0.5, fvar(7)
airguard.velocity= fvar(8)*0.5, fvar(9)
yaccel=0.5
fall=var(20)
air.fall=(var(10)%10>=2)
fall.recover=((var(10)/10)%10=0)
air.juggle=(!var(3))*const(data.airjuggle)
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.ctrltime=0
guard.dist=32
fall.envshake.time=id
fall.envshake.ampl=0
palfx.time=  var(24)%1000
palfx.add=   ((var(21)/1000000)%1000-500),((var(21)/1000)%1000-500),(var(21)%1000-500)
palfx.mul=   ((var(22)/1000000)%1000-500),((var(22)/1000)%1000-500),(var(22)%1000-500)
palfx.sinadd=((var(23)/1000000)%1000-500),((var(23)/1000)%1000-500),(var(23)%1000-500),(var(24)/1000)%1000
palfx.color=0
palfx.invertall=1
;---; v11:hittype_c / v13:animtype / v19:affectteam=f
[state 0] ;[.20b2]
type=hitdef
trigger1=!var(0) && var(11)=20 && var(13)=0 && var(19)=1
attr=a,sp
affectteam=f
id=var(2)
damage=var(8),var(9)
animtype=heavy
air.animtype=back
fall.animtype=back
ground.type=high
air.type=low
hitflag=haf ; hafp ; <- not_hit_crouching
guardflag=ma
hitsound=-1
guardsound=41,0
pausetime=var(7),var(7)+1
sparkno=-1
guard.sparkno=-1
sparkxy=0,0
ground.slidetime=var(7)+12
ground.hittime=  var(7)+12
air.hittime=     var(7)+12
ground.velocity=   fvar(6)*ifelse(var(20),0.5,1), fvar(7)*var(20)
guard.velocity=    fvar(8)
air.velocity=      fvar(6)*0.5, fvar(7)
airguard.velocity= fvar(8)*0.5, fvar(9)
yaccel=0.5
fall=var(20)
air.fall=(var(10)%10>=2)
fall.recover=((var(10)/10)%10=0)
air.juggle=(!var(3))*const(data.airjuggle)
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.ctrltime=0
guard.dist=32
fall.envshake.time=id
fall.envshake.ampl=0
palfx.time=  var(24)%1000
palfx.add=   ((var(21)/1000000)%1000-500),((var(21)/1000)%1000-500),(var(21)%1000-500)
palfx.mul=   ((var(22)/1000000)%1000-500),((var(22)/1000)%1000-500),(var(22)%1000-500)
palfx.sinadd=((var(23)/1000000)%1000-500),((var(23)/1000)%1000-500),(var(23)%1000-500),(var(24)/1000)%1000
palfx.color=0
palfx.invertall=1
;--- ---
;---; v11:hittype_sca / v13:animtype=diagup / v19:affectteam=e
[state 0] ;[.20c1]
type=hitdef
trigger1=!var(0) && var(11)!=20 && var(13)=5 && var(19)=0
attr=a,hp
affectteam=e
id=var(2)
damage=var(8),var(9)
animtype=heavy
air.animtype=back
fall.animtype=diagup
ground.type=high
air.type=low
hitflag=mhaf ; mhafp ; <- hit_all
guardflag=m
hitsound=-1
guardsound=41,0
pausetime=var(7),var(7)+1
sparkno=-1
guard.sparkno=-1
sparkxy=0,0
ground.slidetime=var(7)+12
ground.hittime=  var(7)+12
air.hittime=     var(7)+12
ground.velocity=   fvar(6)*ifelse(var(20),0.5,1), fvar(7)*var(20)
guard.velocity=    fvar(8)
air.velocity=      fvar(6)*0.5, fvar(7)
airguard.velocity= fvar(8)*0.5, fvar(9)
yaccel=0.5
fall=var(20)
air.fall=(var(10)%10>=2)
fall.recover=((var(10)/10)%10=0)
air.juggle=(!var(3))*const(data.airjuggle)
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.ctrltime=0
guard.dist=32
fall.envshake.time=id
fall.envshake.ampl=0
palfx.time=  var(24)%1000
palfx.add=   ((var(21)/1000000)%1000-500),((var(21)/1000)%1000-500),(var(21)%1000-500)
palfx.mul=   ((var(22)/1000000)%1000-500),((var(22)/1000)%1000-500),(var(22)%1000-500)
palfx.sinadd=((var(23)/1000000)%1000-500),((var(23)/1000)%1000-500),(var(23)%1000-500),(var(24)/1000)%1000
palfx.color=0
palfx.invertall=1
;---; v11:hittype_sca / v13:animtype=diagup / v19:affectteam=f
[state 0] ;[.20c2]
type=hitdef
trigger1=!var(0) && var(11)!=20 && var(13)=5 && var(19)=1
attr=a,hp
affectteam=f
id=var(2)
damage=var(8),var(9)
animtype=heavy
air.animtype=back
fall.animtype=diagup
ground.type=high
air.type=low
hitflag=mhaf ; mhafp ; <- hit_all
guardflag=m
hitsound=-1
guardsound=41,0
pausetime=var(7),var(7)+1
sparkno=-1
guard.sparkno=-1
sparkxy=0,0
ground.slidetime=var(7)+12
ground.hittime=  var(7)+12
air.hittime=     var(7)+12
ground.velocity=   fvar(6)*ifelse(var(20),0.5,1), fvar(7)*var(20)
guard.velocity=    fvar(8)
air.velocity=      fvar(6)*0.5, fvar(7)
airguard.velocity= fvar(8)*0.5, fvar(9)
yaccel=0.5
fall=var(20)
air.fall=(var(10)%10>=2)
fall.recover=((var(10)/10)%10=0)
air.juggle=(!var(3))*const(data.airjuggle)
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.ctrltime=0
guard.dist=32
fall.envshake.time=id
fall.envshake.ampl=0
palfx.time=  var(24)%1000
palfx.add=   ((var(21)/1000000)%1000-500),((var(21)/1000)%1000-500),(var(21)%1000-500)
palfx.mul=   ((var(22)/1000000)%1000-500),((var(22)/1000)%1000-500),(var(22)%1000-500)
palfx.sinadd=((var(23)/1000000)%1000-500),((var(23)/1000)%1000-500),(var(23)%1000-500),(var(24)/1000)%1000
palfx.color=0
palfx.invertall=1
;---
;---; v11:hittype_c / v13:animtype=diagup / v19:affectteam=e
[state 0] ;[.20d1]
type=hitdef
trigger1=!var(0) && var(11)=20 && var(13)=5 && var(19)=0
attr=a,hp
affectteam=e
id=var(2)
damage=var(8),var(9)
animtype=heavy
air.animtype=back
fall.animtype=diagup
ground.type=high
air.type=low
hitflag=haf ; hafp ; <- not_hit_crouching
guardflag=m
hitsound=-1
guardsound=41,0
pausetime=var(7),var(7)+1
sparkno=-1
guard.sparkno=-1
sparkxy=0,0
ground.slidetime=var(7)+12
ground.hittime=  var(7)+12
air.hittime=     var(7)+12
ground.velocity=   fvar(6)*ifelse(var(20),0.5,1), fvar(7)*var(20)
guard.velocity=    fvar(8)
air.velocity=      fvar(6)*0.5, fvar(7)
airguard.velocity= fvar(8)*0.5, fvar(9)
yaccel=0.5
fall=var(20)
air.fall=(var(10)%10>=2)
fall.recover=((var(10)/10)%10=0)
air.juggle=(!var(3))*const(data.airjuggle)
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.ctrltime=0
guard.dist=32
fall.envshake.time=id
fall.envshake.ampl=0
palfx.time=  var(24)%1000
palfx.add=   ((var(21)/1000000)%1000-500),((var(21)/1000)%1000-500),(var(21)%1000-500)
palfx.mul=   ((var(22)/1000000)%1000-500),((var(22)/1000)%1000-500),(var(22)%1000-500)
palfx.sinadd=((var(23)/1000000)%1000-500),((var(23)/1000)%1000-500),(var(23)%1000-500),(var(24)/1000)%1000
palfx.color=0
palfx.invertall=1
;---; v11:hittype_c / v13:animtype=diagup / v19:affectteam=f
[state 0] ;[.20d2]
type=hitdef
trigger1=!var(0) && var(11)=20 && var(13)=5 && var(19)=1
attr=a,hp
affectteam=f
id=var(2)
damage=var(8),var(9)
animtype=heavy
air.animtype=back
fall.animtype=diagup
ground.type=high
air.type=low
hitflag=haf ; hafp ; <- not_hit_crouching
guardflag=m
hitsound=-1
guardsound=41,0
pausetime=var(7),var(7)+1
sparkno=-1
guard.sparkno=-1
sparkxy=0,0
ground.slidetime=var(7)+12
ground.hittime=  var(7)+12
air.hittime=     var(7)+12
ground.velocity=   fvar(6)*ifelse(var(20),0.5,1), fvar(7)*var(20)
guard.velocity=    fvar(8)
air.velocity=      fvar(6)*0.5, fvar(7)
airguard.velocity= fvar(8)*0.5, fvar(9)
yaccel=0.5
fall=var(20)
air.fall=(var(10)%10>=2)
fall.recover=((var(10)/10)%10=0)
air.juggle=(!var(3))*const(data.airjuggle)
ground.cornerpush.veloff=0
air.cornerpush.veloff=0
guard.ctrltime=0
guard.dist=32
fall.envshake.time=id
fall.envshake.ampl=0
palfx.time=  var(24)%1000
palfx.add=   ((var(21)/1000000)%1000-500),((var(21)/1000)%1000-500),(var(21)%1000-500)
palfx.mul=   ((var(22)/1000000)%1000-500),((var(22)/1000)%1000-500),(var(22)%1000-500)
palfx.sinadd=((var(23)/1000000)%1000-500),((var(23)/1000)%1000-500),(var(23)%1000-500),(var(24)/1000)%1000
palfx.color=0
palfx.invertall=1
;--- ---
;---
;--- *Reflection ; *”½ŽË”»’è

; player id set
[state 0] ;[.22-0]
type=varset
trigger1=(movecontact) || (!time)
var(33)=id ;; <- set_to_self
persistent=0
[state 0] ;[.22-1]
type=varset
trigger1=(movecontact) && numtarget(var(2))
var(33)=target(var(2)),id
ignorehitpause=1

; check enemy type: reflection
[state 0] ;[.22-5]
type=varset
trigger1=var(33)>0 && playeridexist(var(33))
trigger1=(playerid(var(33)),ishelper)
trigger1=(playerid(var(33)),var(15)=10311) && (playerid(var(33)),var(16)=10212) && (playerid(var(33)),var(17)=10113) && (playerid(var(33)),var(18)=30636)
trigger1=var(30)>2 ;; <-counter
var(31)=1 ;;-> reset
ignorehitpause=1

; flag reset***
[state 0] ;[.22a]
type=varset
trigger1=var(31)
var(3)=0 ;;<-hit_count
ignorehitpause=1
[state 0] ;[.22b]
type=movehitreset
trigger1=var(31)
ignorehitpause=1

[state 0] ;[.23a]
type=statetypeset
trigger1=var(19)=1 && var(30)<9
movetype=i
ignorehitpause=1
[state 0] ;[.22b]
type=statetypeset
trigger1=var(19)=1 && var(30)>8
movetype=a
ignorehitpause=1
;---
;--- hit_sound
[state 0] ;[.23a]
type=playsnd
trigger1=(movehit=1) && numtarget && (hitpausetime>0) && (hitpausetime=[var(7)-1,var(7)])
trigger1=var(31)!=1 ;;<-not_a_reflection
value=f300,var(34)
channel=1
ignorehitpause=1

;--- hit_spark_dist_x
[state 0] ;[.23e] ;; Get_P2Dist_X
type=varset
trigger1=(movecontact=1)
trigger1=var(31)!=1 ;;<-not a reflection
trigger1=var(33)>0 && playeridexist(var(33)) || (fvar(4):=0) ;;<- init
fvar(4)=(playerid(var(33)),pos x-pos x)*facing ;;<- P2Dist_X
ignorehitpause=1
;--- hit_spark
[state 0] ;[.23g]
type=helper
trigger1=(movecontact=1) && (!movereversed) && numtarget && (hitpausetime>0) && (hitpausetime=[var(7)-1,var(7)])
trigger1=var(31)!=1 ;;<-not_a_reflection
id=152100
stateno=152100
helpertype=normal
ownpal=1
keyctrl=0
postype=p1
pos=floor(fvar(4))
size.height=ifelse(movehit,var(35),40+var(35)) ;; hit/guard_spark
ignorehitpause=1
facing=-1
;--- burn_spark
[state 0] ;[.23i]
type=helper
trigger1=(movehit=1) && (!movereversed) && numtarget(var(2)) && (hitpausetime>0) && (hitpausetime=[var(7)-1,var(7)])
trigger1=var(31)!=1 ;;<-not a reflection
trigger1=(var(11)=[10,12]) && (numhelper(152200)=0) && (root,numhelper(152200)=0) ;; fire switch & fire-helper existing
trigger1=var(33)>0 && playeridexist(var(33))
trigger1=(playerid(var(33)),var(15)!=10311)||(playerid(var(33)),var(16)!=10212)||(playerid(var(33)),var(17)!=10113)||(playerid(var(33)),var(18)!=30636)
id=152200
stateno=152200
helpertype=normal
ownpal=1
keyctrl=0
;;--- property reset
size.height=(var(33)*10)+(var(11)%10) ;; player_id * 10 + type(0:red/1:blue)
size.head.pos=(root,const(size.head.pos.x)),(root,const(size.head.pos.y)) ;; <-anim,hitanim
size.mid.pos= (root,const(size.mid.pos.x)), (root,const(size.mid.pos.y))  ;; <-speed_x,y(1/1000)
size.ground.front=root,const(size.ground.front) ;; <-max_hits/miss_time
size.ground.back= root,const(size.ground.back)  ;; <-damage hit/guard
size.air.front=   root,const(size.air.front)    ;; <-hit_x(1/1000)
size.air.back=    root,const(size.air.back)     ;; <-hit_y(1/1000)
size.shadowoffset=root,const(size.shadowoffset) ;; <-fall(10=recovery/1=ground/2=air/3=g&a)
;op; ownpal=1
size.xscale=1
size.yscale=1
;---
ignorehitpause=1
persistent=0 ;*@@@@@@@@
;--- getpower/givepower
[state 0] ;[.23k]
type=poweradd
trigger1=(movecontact=1) && numtarget && (hitpausetime>0) && (hitpausetime=[var(7)-1,var(7)])
trigger1=var(31)!=1 ;;<-not_a_reflection
value=ifelse(movehit,80,40) *(var(2)<3000)
ignorehitpause=1
;---
;--- moving
[state 0] ;[.24a]
type=velset
trigger1=1
;old; x=fvar(0)
;old; y=fvar(1)
x=fvar(0):=fvar(0)+fvar(10)
y=fvar(1):=fvar(1)+fvar(11)
[state 0] ;[.24b]
type=posfreeze
trigger1=movecontact && !var(31)
trigger2=numtarget(var(2)) && !var(31)
trigger2=target(var(2)),hitshakeover=0
trigger3=!time && var(30)>1
trigger4=var(0)
ignorehitpause=1

; count contacts ; ÚG”‰ÁŽZ
[state 0] ;[.24e]
type=varadd
trigger1=!time && var(30)>1
trigger2=(movecontact=1) && !var(31)
trigger3=var(12)>1 && (root,numprojid(var(1))=0) && (root,projcanceltime(var(1))=1) && var(19)=0 ;;|| (var(19)=1 && var(30)>9)
var(3)=1 ; <- hitcount ; –½’†”‰ÁŽZ
ignorehitpause=1

; check-out ; Á–Å”»’è
[state 0] ;[.24i]
type=varset
trigger1=var(3)>=var(6) ;;<- hit_times ;–½’†”
trigger2=fvar(1)>0 && (pos y+vel y>=0) ;;<- on_ground ;’n–ʐڐG
trigger3=var(12)>var(4) ;;<- time_elapsed ;”­ŽËŒãŽžŠÔŒo‰ß(ƒJƒEƒ“ƒgƒ_ƒEƒ“)
trigger4=time>3456 ;;<- for_safety
var(0)=1 ;;<-contact_switch ;ÚGÁ–ŃXƒCƒbƒ`
ignorehitpause=1
[state 0] ;[.24j]
type=varset
trigger1=var(12)>var(4) ;;<- time_elapsed ;”­ŽËŒãŽžŠÔŒo‰ß(ƒJƒEƒ“ƒgƒ_ƒEƒ“)
trigger1=var(14)>=5 ;;<-options
trigger2=frontedgedist<=-128 ;;<- out_screen ;‰æ–ÊŠO
var(0)=2 ;;<- non-contact ;–³ÚGÁ–ŃXƒCƒbƒ`
ignorehitpause=1
;---
; temp_proj_for_contact ; ƒvƒƒWƒFÚG”»’è—pƒ_ƒ~[
[state 0] ;[.24n]
type=projectile
trigger1=!var(0) && var(19)=0 ;;<-for_enemy
projid=var(1)
affectteam=e
projanim=909601 ;; empty
projscale=0,0
sparkno=-1
projhitanim=-1
projedgebound=600
projstagebound=600
getpower=0,0
givepower=0,0
projremovetime=1
ignorehitpause=1
[state 0] ;[.24m]
type=projectile
trigger1=!var(0) && var(19)=1 ;;<-for_self
projid=var(1)
affectteam=f
projanim=909601 ;; empty
projscale=0,0
sparkno=-1
projhitanim=-1
projedgebound=600
projstagebound=600
getpower=0,0
givepower=0,0
projremovetime=1
ignorehitpause=1
;---
[state 0] ;[.24o]
type=movehitreset
trigger1=1
ignorehitpause=1
;---
;--- temp proj for screen-in ; oŒ»”»’è—pƒ_ƒ~[
[state 0] ;[.24p]
type=projectile
trigger1=var(19)=0 ;;<-for_enemy
projid=stateno
projanim=909601 ;; empty
projscale=0,0
sparkno=-1
projhitanim=-1
projremovetime=1
ignorehitpause=1

;--- --- temy_proj_for_distance_check ; ‹——£Œv—pƒ_ƒ~[
; give opponent informatimes to_against_proj
; ”ò‚Ñ“¹‹ï‘Ώˆ(‘ŠŽè)
; ID action
; 010 guard
; 020 guard/roll/jump
; 030 roll/jump
; 040 jump
; 050 jump_fwd
[state 0] ;st.220-1
type=varset
trigger1=numenemy
var(40)=floor((enemynear,screenpos x-screenpos x)*facing/ifelse(fvar(0),fvar(0),0.0001))
;//;v(40):‘ŠŽè‚ɐڐG‚܂ł̃tƒŒ[ƒ€”ƒJƒEƒ“ƒgƒ_ƒEƒ“(ŠTŽZ)
[state 0] ;[.25a]
type=varset
trigger1=1
var(41)=(1+(var(40)>17)+(var(40)>26)+(var(40)>36)+(var(40)>188))*10
[state 0] ;[.25b]
type=projectile
trigger1=var(40)>0 && var(19)=0 ;;<-for_enemy
projid=stateno+var(41)
projanim=909601 ;; empty
projscale=0,0
sparkno=-1
projhitanim=-1
projremovetime=1
ignorehitpause=1
;--- ---
;;[state 0] ; target_distance
;; type=displaytoclipboard
;; trigger1=numenemy
;; text="V=[%d] VD=[%d] x=[%d] target_x=[%d]"; D=[%d]"
;; params=var(41),var(40),floor(screenpos x),floor(enemynear,screenpos x);,floor(enemynear,screenpos x-screenpos x)*facing
;--- ---
;---
[state 0] ;[.25d] ; hit_end
type=helper
trigger1=var(0)=1
stateno=91100
postype=p1
pos=0,0
ownpal=1
size.head.pos=const(size.head.pos.y),0 ;;<- anim,
size.height= ( var(31) || (var(0)=1 && var(3)>=var(6)) ) ;;<-effect_type
;;--- v30:reflection_swotch  /  v0:contact_switch  /  v3,6: max_hit_times
ignorehitpause=1
persistent=0
;---
[state 0] ;[.25e] ;; ground_wave
type=helper
trigger1=var(0)=1 && (pos y+vel y>0)
id=159005
stateno=159005
ownpal=1
pos=0,floor(-pos y)
size.height=0
size.ground.front=(root,const(size.ground.front))
size.ground.back= (root,const(size.ground.back))
persistent=0
[state 0] ;[.25g] ;; dash_dust - hit_on_ground
type=helper
trigger1=var(0)=1 && (pos y+vel y>0)
id=152040
stateno=152040
ownpal=1
pos=floor(-18*const(size.xscale)),floor(-pos y)
size.xscale=0.5*const(size.xscale)
size.yscale=0.5*const(size.yscale)
size.ground.front=(root,const(size.ground.front))
size.ground.back= (root,const(size.ground.back))
persistent=0
[state 0] ;[.25i] ;; dash_dust - hit_on_ground
type=helper
trigger1=var(0)=1 && (pos y+vel y>0)
id=152040
stateno=152040
ownpal=1
pos=floor(18*const(size.xscale)),floor(-pos y)
size.xscale=-0.5*const(size.xscale)
size.yscale= 0.5*const(size.yscale)
size.ground.front=(root,const(size.ground.front))
size.ground.back= (root,const(size.ground.back))
persistent=0
;---
;---
[state 0] ;[.25k]
type=removeexplod
trigger1=var(0)
id=1
ignorehitpause=1
[state 0] ;[.25m]
type=removeexplod
trigger1=var(0)
id=2
ignorehitpause=1
[state 0] ;[.25n]
type=destroyself
trigger1=var(0)
ignorehitpause=1
;---
;--- eject_effect ; ŽËo‰‰o
[state 0] ;[.25o]
type=explod
trigger1=!var(32) && (root,pos y>-18) && !root,numprojid(91005)
anim=f210560
postype=p1
pos=floor(root,pos x-pos x)*facing,floor(-pos y)
scale=-ifelse(ishelper(3000),1.5,1),ifelse(ishelper(3000),2.2,1.5)
sprpriority=-8
ownpal=1
trans=sub
persistent=0
[state 0] ;[.25p]
type=explod
trigger1=!var(32) && (root,pos y>-18) && !root,numprojid(91005)
anim=f210560
postype=p1
pos=floor(root,pos x-pos x)*facing,floor(-pos y)
scale=-ifelse(ishelper(3000),1.5,1),ifelse(ishelper(3000),2.2,1.5)
sprpriority=5
ownpal=1
persistent=0
;---
[state 0] ;[.25q] ;; dash_dust - eject
type=helper
trigger1=!var(32) && (vel y<=0) && (pos y>-100) && !root,numprojid(91005)
id=152040
stateno=152040
ownpal=1
pos=floor(-52*root,const(size.xscale)),floor(-pos y)
size.xscale=ifelse(ishelper(3000),1.10,0.75)
size.yscale=ifelse(ishelper(3000),1.10,0.75)
size.ground.front=(root,const(size.ground.front))
size.ground.back= (root,const(size.ground.back))
persistent=0
[state 0] ;[.25r] ;; dash_dust - ejject
type=helper
trigger1=!var(32) && (vel y<=0) && (pos y>-100) && !root,numprojid(91005)
id=152040
stateno=152040
ownpal=1
pos=floor(-12*root,const(size.xscale)),floor(-pos y)
size.xscale=-ifelse(ishelper(3000),0.65,0.45)
size.yscale= ifelse(ishelper(3000),0.65,0.45)
size.ground.front=(root,const(size.ground.front))
size.ground.back= (root,const(size.ground.back))
persistent=0
[state 0] ;[.25s] ;; eject_flag
type=projectile
trigger1=!var(32) ;;<-only_once
projid=91005
projanim=909601 ;; empty
projscale=0,0
sparkno=-1
projhitanim=-1
projremovetime=32;; <- within_32_frames
;---
;--- counter
[state 0] ;[.26]
type=varadd
trigger1=1
var(32)=1
ignorehitpause=1
;--- ---
;--- ---

this is a projectile and reflection system it uses size values of helper to set up anim vels,damage etc
it can be used in two ways,
as an regular projectile
;---
Spoiler, click to toggle visibilty
Spoiler, click to toggle visibilty
Can any expert tell me how does this code work properly? I cant seem to understand how size values of helper work its probably doing some math to these values to get the actual value.
Note this is for fullgame hence I'm not using vans reflector

Re: Projectile Clone/Reflection Code Shiyo Kakuge
#2  September 16, 2023, 04:28:10 am
  • *****
  • Shame on you!
    • USA
Im laying down reading sideways so....
But yeah it looks like it's doing some bit operations on the values. The creator is basically using the value(s) as a variable, and the specific numbers are being undone.
size.shadowoffset=2;;<-fall(10=recovery/1=ground/2=air/3=g&a)
this ^^ is probably the most obvious one. If you wanted to change you know what putting a 3 will do. Something like this, 4, or any number not listed probably wont work.
  size.ground.back=800010;;<-damage hit/guard
just looking at it and guessing, it's probably doing 80 damage and 10 chip damage.

The variables they set up are commented pretty good.
Look at the hitdef(s) and see the variables used. Then scroll up and read the description(s). That hitdef can pass THAT info on with this method. Transferring a variable from p1 to p2, this is probably the best option. I _Think_ there's info in Mugen Class>Hitdef about this
vVv Gouken718 vVv