Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "./eff/effects.txt"
- #include "./lib_sfx.txt"
- function wait(w) {
- loop(w) { yield; }
- }
- function angleToPlayer(enm) {
- let dir = atan2(GetPlayerY-ObjMove_GetY(enm),GetPlayerX-ObjMove_GetX(enm));
- return dir;
- }
- function BossToCoord(enm,xpos,ypos){
- let dir = atan2(ypos-ObjMove_GetY(enm),xpos-ObjMove_GetX(enm));
- return dir;
- }
- function CoordToPlayer(xpos,ypos){
- let dir = atan2(GetPlayerY-ypos,GetPlayerX-xpos);
- return dir;
- }
- function CoordToBoss(enm,xpos,ypos){
- let dir = atan2(ObjMove_GetY(enm)-ypos,ObjMove_GetX(enm)-xpos);
- return dir;
- }
- function RoundUp(area,value){
- let num = (area-value%area)+value;
- return num;
- }
- function RoundDown(area,value){
- let num = value-value%area;
- return num;
- }
- function GetCoordDistance(pos1,pos2){
- let dist = ((pos2[0]-pos1[0])^2+(pos2[1]-pos1[1])^2)^0.5;
- return dist;
- }
- function GetObjDistance(obj1,obj2){
- let dist = ((ObjMove_GetX(obj2)-ObjMove_GetX(obj1))^2+(ObjMove_GetY(obj2)-ObjMove_GetY(obj1))^2)^0.5;
- return dist;
- }
- function GetRandInt(f,c){
- let num = round(rand(f,c));
- return num;
- }
- task bulletControl01(enm,sobj,delay,maxsp,acc,agv) {
- if(ObjEnemy_GetInfo(enm,INFO_LIFE) <= 0) {return;}
- wait(delay);
- ObjMove_SetMaxSpeed(sobj,maxsp);
- ObjMove_SetAcceleration(sobj,acc);
- ObjMove_SetAngularVelocity(sobj,agv);
- }
- task bulletControl01B(enm,sobj,delay,delay2,maxsp,acc,maxsp2,acc2,agv) {
- if(ObjEnemy_GetInfo(enm,INFO_LIFE) <= 0) {return;}
- wait(delay);
- ObjMove_SetMaxSpeed(sobj,maxsp);
- ObjMove_SetAcceleration(sobj,acc);
- wait(delay2);
- ObjMove_SetMaxSpeed(sobj,maxsp2);
- ObjMove_SetAcceleration(sobj,acc2);
- ObjMove_SetAngularVelocity(sobj,agv);
- }
- task SetGraphicAtFrame(sobj,frame,shotID){
- wait(frame);
- ObjShot_SetGraphic(sobj,shotID);
- }
- task SetGraphicAtPosition(sobj,xpos,ypos,shotID){
- if(ObjMove_GetX(sobj)==xpos && ObjMove_GetY(sobj)==ypos){
- ObjShot_SetGraphic(sobj,shotID);
- }
- }
- task SetBulletSpellResistAtFrame(sobj,frame,resist){
- wait(frame);
- ObjShot_SetSpellResist(sobj,resist);
- }
- task soundControl(enm,delay,sfx,vol) {
- if(ObjEnemy_GetInfo(enm,INFO_LIFE) <= 0) {return;}
- wait(delay);
- ObjSound_Play(sfx);
- ObjSound_SetVolumeRate(sfx,vol);
- }
Advertisement
Add Comment
Please, Sign In to add comment