Cirno2022/script/KevinSystem/kevin_system/Kevin_ItemLib.txt

150 lines
3.9 KiB
Plaintext

// Valid types: PIV_100, PIV_250, PIV_500
float universalItemAlpha = GetAreaCommonData("Config", "ItemOpacity", 60);
function CreatePIVItem(itemtype, x, y){
let PIVItem = CreateItemU1(itemtype, x, y, 0);
ObjItem_SetDefaultCollectMovement(PIVItem, false);
ObjItem_SetAutoDelete(PIVItem, false);
ObjMove_SetAngle(PIVItem, 90);
ObjMove_SetSpeed(PIVItem, -10);
ObjMove_SetAcceleration(PIVItem, 1);
ObjMove_SetMaxSpeed(PIVItem, 0);
/*async{
wait(20);
ObjMove_SetMaxSpeed(PIVItem, 24);
ObjItem_SetMoveToPlayer(PIVItem, true);
}*/
//ObjItem_SetAutoCollectEnableFlags(PIVItem, ITEM_AUTOCOLLECT_ALL);
ObjItem_SetIntersectionRadius(PIVItem, 60);
ObjRender_SetScaleXYZ(PIVItem, 0.85, 0.85, 1);
ObjRender_SetAlpha(PIVItem, 255*(universalItemAlpha/100));
async{
while(!Obj_IsDeleted(PIVItem)){
float angz = ObjRender_GetAngleZ(PIVItem);
ObjRender_SetAngleZ(PIVItem, angz+3.5);
yield;
}
}
return PIVItem;
}
// Valid types: POINT_REGULAR, POINT_BHESTIE, POINT_RAINBOW
function CreateScoreItem(itemtype, x, y){
let ScoreItem = CreateItemU1(itemtype, x + rand(-60, 60), y + rand(-60, 60), 0);
ObjItem_SetDefaultCollectMovement(ScoreItem, false);
ObjItem_SetAutoDelete(ScoreItem, false);
ObjMove_SetAngle(ScoreItem, 90);
ObjMove_SetSpeed(ScoreItem, -20);
ObjMove_SetAcceleration(ScoreItem, 1);
ObjMove_SetMaxSpeed(ScoreItem, 0);
ObjItem_SetIntersectionRadius(ScoreItem, 60);
ObjItem_SetRenderScoreEnable(ScoreItem, false);
ObjRender_SetAlpha(ScoreItem, 255*(universalItemAlpha/100));
return ScoreItem;
}
function CreateCancelItem(x, y){
let CancelItem = CreateItemU1(POINT_CANCEL, x, y, 0);
ObjItem_SetDefaultCollectMovement(CancelItem, false);
/*async{
wait(45);
ObjItem_SetMoveToPlayer(CancelItem, true);
ObjMove_SetMaxSpeed(CancelItem, 24);
}*/
ObjItem_SetAutoCollectEnableFlags(CancelItem, ITEM_AUTOCOLLECT_ALL);
ObjItem_SetRenderScoreEnable(CancelItem, false);
ObjItem_SetIntersectionRadius(CancelItem, 60);
ObjRender_SetScaleXYZ(CancelItem, 0.6, 0.6, 1);
ObjRender_SetAlpha(CancelItem, 255*(universalItemAlpha/100));
async{
while(!Obj_IsDeleted(CancelItem)){
float angz = ObjRender_GetAngleZ(CancelItem);
ObjRender_SetAngleZ(CancelItem, angz+2);
yield;
}
}
return CancelItem;
}
// Valid types: EXTEND_LIFE, EXTEND_SPELL
function CreateExtendItem(itemtype, x, y){
let ExtendItem = CreateItemU2(itemtype, x, y, x, y-125, 0);
ObjItem_SetDefaultCollectMovement(ExtendItem, false);
//ObjItem_SetMoveToPlayer(ExtendItem, true);
ObjItem_SetAutoCollectEnableFlags(ExtendItem, ITEM_AUTOCOLLECT_ALL);
ObjMove_SetAngle(ExtendItem, 90);
ObjMove_SetSpeed(ExtendItem, -20);
ObjMove_SetAcceleration(ExtendItem, 1);
ObjMove_SetMaxSpeed(ExtendItem, 0);
ObjRender_SetScaleXYZ(ExtendItem, 1.5, 1.5, 1);
Obj_SetRenderPriorityI(ExtendItem, 49);
ObjItem_SetAutoDelete(ExtendItem, false);
/*async{
wait(30);
ObjItem_SetMoveToPlayer(ExtendItem, true);
//ObjMove_SetMaxSpeed(CancelItem, 24);
}*/
return ExtendItem;
}
// Summoning the actual items
function NonspellItemDrop(scene, x, y){
if(ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0){
loop(14){
CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45));
}
}
else{
loop(8){
CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45));
}
}
}
function SpellItemDrop(scene, x, y){
if(ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SPELL_COUNT) == 0){
loop(20){
CreateScoreItem(POINT_BHESTIE, x+rand(-75, 75), y+rand(-45, 45));
}
loop(10){
CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45));
}
}
else if(ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SPELL_COUNT) >> 0){
loop(12){
CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45));
}
}
else{}
}