NarumiSTG_HyperSnowDrifter/script/KevinSystem/KevinShot/misc.txt

33 lines
1.7 KiB
Plaintext

/*
For Danmakufu users.
These functions are meant to be used alongside my pastel shotsheet due to the very high native resolution.
*/
// Bullet rescaling task, also has functionality for setting a new hitbox size relative to the new bullet graphic size. I highly recommend leaving hitboxscale to true.
task _BulletRescale(target, float scale, bool hitboxscale, hitboxlevel){
ObjRender_SetScaleXYZ(target, scale, scale, 1);
if (hitboxscale){
ObjShot_SetIntersectionScaleXY(target, scale*hitboxlevel, scale*hitboxlevel); // Note the formula. The hitbox will have been scaled accordingly along with the bullet graphic, but you can use hitboxlevel to adjust the scale further.
return;
}
else{return;}
}
// Delay task, provided by Naudiz (@Naudogs). For best effects, ensure destscale is equal to the resized scale of the bullet graphic, and orgscale be larger than it.
task _Delay(target, del, orgscale, destscale, orgalpha, destalpha){
ObjShot_SetDelay(target, del);
ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target)); // unless you already have the ID in the function somewhere, in which case you can just use that, or use any other graphic
ObjShot_SetDelayMode(target, DELAY_LERP, LERP_ACCELERATE, LERP_DECELERATE); // delay mode, scale lerp, alpha lerp. Check ph3sx's New Functions Documentation.txt for more details.
ObjShot_SetDelayScaleParameter(target, destscale, orgscale, del); // lerps from orgscale to destscale scale in del frames (use the value from ObjShot_SetDelay for del)
ObjShot_SetDelayAlphaParameter(target, destalpha, orgalpha, del); // lerps from orgalpha to destalpha scale in del frames (use the value from ObjShot_SetDelay for del)
return;
}