ScarletBlackMarket/KevinSystem/kevin_system/Kevin_ItemLib.txt

147 lines
3.7 KiB
Plaintext

// Valid types: PIV_100, PIV_250, PIV_500
float universalItemAlpha = GetAreaCommonData("Config", "ItemOpacity", 60);
const EV_DROP_POINT_ENEMY = EV_USER + 200i;
const EV_DROP_PIV_ENEMY = EV_USER + 201i;
const EV_SINGLE_ITEM_DROP = EV_USER + 202i;
const EV_DROP_EXTEND = EV_USER + 203i;
function CreatePIVItem(itemtype, x, y){
let PIVItem = CreateItemU1(itemtype, x, y, 0);
ObjItem_SetDefaultCollectMovement(PIVItem, false);
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);
async{
wait(45);
ObjItem_SetMoveToPlayer(ScoreItem, true);
}
//ObjItem_SetAutoCollectEnableFlags(ScoreItem, ITEM_AUTOCOLLECT_ALL);
ObjItem_SetIntersectionRadius(ScoreItem, 60);
ObjItem_SetRenderScoreEnable(ScoreItem, false);
//ObjRender_SetScaleXYZ(ScoreItem, 0.7, 0.7, 1);
ObjRender_SetAlpha(ScoreItem, 255*(universalItemAlpha/100));
//ObjMove_AddPatternA2(ScoreItem, 60, NO_CHANGE, 90, 0.12, 5.45, 0);
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);
ObjRender_SetScaleXYZ(ExtendItem, 1.5, 1.5, 1);
Obj_SetRenderPriorityI(ExtendItem, 49);
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{}
}