diff --git a/script/KevinSystem/Universal_EnemyLib.dnh b/script/KevinSystem/Universal_EnemyLib.dnh index 099c71b..ad23732 100644 --- a/script/KevinSystem/Universal_EnemyLib.dnh +++ b/script/KevinSystem/Universal_EnemyLib.dnh @@ -201,12 +201,25 @@ function _CreateEnemy( task _HandleEnemyWellbeing(int enemyID, float sizeHitbox, float sizeHurtbox){ + float enmX = 0, enmY = 0; + while(ObjEnemy_GetInfo(enemyID, INFO_LIFE) > 0){ - ObjEnemy_SetIntersectionCircleToShot(enemyID, ObjMove_GetX(enemyID), ObjMove_GetY(enemyID), sizeHitbox); - ObjEnemy_SetIntersectionCircleToPlayer(enemyID, ObjMove_GetX(enemyID), ObjMove_GetY(enemyID), sizeHurtbox); + + enmX = ObjMove_GetX(enemyID); + enmY = ObjMove_GetY(enemyID); + + if(ObjEnemy_GetInfo(enemyID, INFO_LIFE) <= 0){break;} + + else{ + ObjEnemy_SetIntersectionCircleToShot(enemyID, enmX, enmY, sizeHitbox); + } + //ObjEnemy_SetIntersectionCircleToPlayer(enemyID, ObjMove_GetX(enemyID), ObjMove_GetY(enemyID), sizeHurtbox); yield; + } + Obj_Delete(enemyID); + } @@ -813,11 +826,12 @@ task _EnemyItemDrop( ObjEnemy_SetDamageRate(Bitch, 100, 100); while(ObjEnemy_GetInfo(Bitch, INFO_LIFE) > 0){ + enmX = ObjMove_GetX(Bitch); enmY = ObjMove_GetY(Bitch); - dmgCheck = ObjEnemy_GetInfo(Bitch, INFO_DAMAGE_PREVIOUS_FRAME); timer++; yield; + } if( @@ -839,6 +853,9 @@ task _EnemyItemDrop( NotifyEvent(GetCommonDataPtr(ITEMID_PTR, 0), EV_DROP_POINT_ENEMY, [enmX, enmY], timer, maxTimer, minPoint, maxPoint); NotifyEvent(GetCommonDataPtr(ITEMID_PTR, 0), EV_DROP_PIV_ENEMY, GetPlayerObjectID(), [enmX, enmY], minPIV, maxPIV, maxDist); NotifyEvent(GetCommonDataPtr(SYSTEMID_PTR, 0), EV_EXPLODE, [enmX, enmY]); + } + else{} + } \ No newline at end of file