commit 1
This commit is contained in:
commit
d3ada59252
391 changed files with 25819 additions and 0 deletions
245
script/player/Narumi/Player_Function.dnh
Normal file
245
script/player/Narumi/Player_Function.dnh
Normal file
|
@ -0,0 +1,245 @@
|
|||
#include "./Player_Function_Laser.dnh"
|
||||
|
||||
// Shot Type
|
||||
|
||||
int[] optionArr = [];
|
||||
float angSpace = 2.5;
|
||||
|
||||
float[] angStartArr = [];
|
||||
|
||||
// Far left, left, right, far right
|
||||
|
||||
float[] angStartUF = [230, 270, 270, 310];
|
||||
float[] angStartUFAlt = [230, 275, 265, 310];
|
||||
float[] angStartF = [250, 280, 260, 290];
|
||||
|
||||
float offsetX = 125;
|
||||
float offsetY = 75;
|
||||
|
||||
int[] bulletNum = [4, 3, 3, 4];
|
||||
|
||||
task ShotType(){
|
||||
}
|
||||
|
||||
task BaseShot(){
|
||||
|
||||
// 5 way shot
|
||||
float[] angDist = [10, 5];
|
||||
float ang = -7.5;
|
||||
float ang2 = -22.5;
|
||||
|
||||
while(true){
|
||||
|
||||
if(GetVirtualKeyState(VK_SPELL) == KEY_FREE && IsPermitPlayerShot && !ripplayer){
|
||||
|
||||
// C for alt shot
|
||||
if(GetVirtualKeyState(VK_USER1) != KEY_FREE){
|
||||
|
||||
if(shotspeed % 4 == 0){
|
||||
|
||||
ObjSound_Play(Base3);
|
||||
|
||||
ascent(i in 0..3){
|
||||
|
||||
let shotA = CreatePlayerShotA1(playerX, playerY, 52, ang2 - ang2 * (i * 1), shotDamageOption, 1.5, AMULET);
|
||||
_BulletRescalePlayer(shotA, shotScaleOption, true, 1);
|
||||
ObjRender_SetAlpha(shotA, shotAlpha);
|
||||
Obj_SetRenderPriorityI(shotA, 41);
|
||||
|
||||
}
|
||||
|
||||
ascent(i in 0..3){
|
||||
|
||||
let shotB = CreatePlayerShotA1(playerX, playerY, 52, ang2 - ang2 * (i * 1) + 180, shotDamageOption, 1.5, AMULET);
|
||||
_BulletRescalePlayer(shotB, shotScaleOption, true, 1);
|
||||
ObjRender_SetAlpha(shotB, shotAlpha);
|
||||
Obj_SetRenderPriorityI(shotB, 41);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Z/Z+C for normal shot
|
||||
|
||||
else if(GetVirtualKeyState(VK_SHOT) != KEY_FREE && GetVirtualKeyState(VK_USER1) == KEY_FREE){
|
||||
|
||||
if(shotspeed % 4 == 0){
|
||||
|
||||
ObjSound_Play(Base3);
|
||||
|
||||
ascent(b in -2..3){
|
||||
|
||||
let shotC = CreatePlayerShotA1(playerX, playerY, 52, 0 + ang * b, shotDamageOption, 1.5, AMULET);
|
||||
_BulletRescalePlayer(shotC, shotScaleOption, true, 1);
|
||||
ObjRender_SetAlpha(shotC, shotAlpha);
|
||||
Obj_SetRenderPriorityI(shotC, 41);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else{}
|
||||
|
||||
}
|
||||
|
||||
yield;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
task SpecialWeapon(){
|
||||
|
||||
// Create projectile, but disable hitbox & visibility
|
||||
|
||||
int golem = CreatePlayerShotA1(playerX+128, playerY, 0, 0, shotDamageSpecial * 5.25, 999999, GOLEM);
|
||||
ObjShot_SetAutoDelete(golem, false);
|
||||
ObjShot_SetEraseShot(golem, true);
|
||||
ObjShot_SetPenetrateShotEnable(golem, true);
|
||||
ObjShot_SetIntersectionEnable(golem, false);
|
||||
Obj_SetVisible(golem, false);
|
||||
ObjRender_SetAlpha(golem, 0);
|
||||
ObjShot_SetSpellFactor(golem, true);
|
||||
_BulletRescalePlayer(golem, 1.5, true, 1);
|
||||
ObjShot_SetSpinAngularVelocity(golem, 6);
|
||||
|
||||
float i = 0;
|
||||
|
||||
while(true){
|
||||
|
||||
if(GetVirtualKeyState(VK_SPELL) != KEY_FREE && GetCommonDataPtr(POINTER_SPECIALAMMO, 100) > 0 && !ripplayer){
|
||||
|
||||
if(shotspeed % 4 == 0){ObjSound_Play(Fire);}
|
||||
|
||||
i = min(210, i+210/10);
|
||||
ObjMove_SetPosition(golem, playerX + i, playerY);
|
||||
ObjRender_SetAlpha(golem, min(255, ObjRender_GetAlpha(golem)+255/10));
|
||||
|
||||
//SetCommonDataPtr(POINTER_SPECIALCHECK, true);
|
||||
SetCommonDataPtr(POINTER_CHAINCHECK, true);
|
||||
SetPlayerSpeed(PlayerSpd[0]*1.5, PlayerSpd[1]*1.5);
|
||||
// (Approx.) 20 ammo per second
|
||||
|
||||
SetCommonDataPtr(POINTER_SPECIALAMMO, max(0, GetCommonDataPtr(POINTER_SPECIALAMMO, 100)-(20/60)));
|
||||
ObjShot_SetIntersectionEnable(golem, true);
|
||||
Obj_SetVisible(golem, true);
|
||||
|
||||
// +1 rank per 10 seconds of use
|
||||
|
||||
SetCommonData("Rank", clamp(GetCommonData("Rank", 1)+1/600, 1, GetCommonData("MaxRank", 6)));
|
||||
|
||||
/*
|
||||
if(shotspeed % 4 == 0){
|
||||
|
||||
float x = ObjMove_GetX(ID);
|
||||
float y = ObjMove_GetY(ID);
|
||||
|
||||
// Minimal rank boost -> +0.5 rank for every 10 seconds of the wpn being used -> 1/20 rank every sec -> 1/300 rank every 4 frames
|
||||
|
||||
SetCommonData("Rank", clamp(GetCommonData("Rank", 1) + 1/300, GetCommonData("MinRank", 1), GetCommonData("MaxRank", 12)));
|
||||
|
||||
angFire[0] = 270 + angFlux * sin(ang1) + rand(-5, 5);
|
||||
angFire[1] = 270 + angFlux * sin(ang2) + rand(-5, 5);
|
||||
// YASS FIRE THOSE BITCH KILLER SLASHES
|
||||
FireSlash(angFire[0], 50, 35, 45);
|
||||
FireSlash(angFire[1], 50, 35, 45);
|
||||
|
||||
ang1 += 25;
|
||||
ang2 -= 25;
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
// Refills 5 ammo per second
|
||||
|
||||
i = max(0, i-210/10);
|
||||
ObjMove_SetPosition(golem, playerX + i, playerY);
|
||||
ObjRender_SetAlpha(golem, max(0, ObjRender_GetAlpha(golem)-255/10));
|
||||
|
||||
SetPlayerSpeed(PlayerSpd[0], PlayerSpd[1]);
|
||||
SetCommonDataPtr(POINTER_SPECIALAMMO, min(100, GetCommonDataPtr(POINTER_SPECIALAMMO, 100)+(5/60)));
|
||||
SetCommonDataPtr(POINTER_CHAINCHECK, false);
|
||||
ObjShot_SetIntersectionEnable(golem, false);
|
||||
|
||||
//if(GetCommonDataPtr(POINTER_CHAINGAUGE, 0) <= 0){SetCommonDataPtr(POINTER_SPECIALCHECK, false);}
|
||||
|
||||
}
|
||||
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
task FireSlash(
|
||||
float angle, baseSpd,
|
||||
int decelTime, lifeTime
|
||||
){
|
||||
|
||||
int slash = CreatePlayerShotA1(playerX, playerY, baseSpd, angle, shotDamageSpecial, 8, 1);
|
||||
ObjShot_SetPenetrateShotEnable(slash, false);
|
||||
_BulletRescalePlayer(slash, shotScaleSpecial, true, 1);
|
||||
|
||||
Obj_SetRenderPriorityI(slash, plrender-1);
|
||||
|
||||
//ObjRender_SetBlendType(slash, BLEND_ADD_ARGB);
|
||||
ObjSound_Play(Base5);
|
||||
ObjShot_SetEraseShot(slash, true);
|
||||
|
||||
async{
|
||||
|
||||
ascent(i in 0..3){
|
||||
int slashA = CreatePlayerShotA1(playerX, playerY, baseSpd, angle, shotDamageSpecial/5, 32, 1);
|
||||
_BulletRescalePlayer(slashA, shotScaleSpecial/2, true, 1);
|
||||
//ObjRender_SetBlendType(slashA, BLEND_ADD_ARGB);
|
||||
ObjShot_SetPenetrateShotEnable(slashA, false);
|
||||
Obj_SetRenderPriorityI(slashA, plrender-1);
|
||||
Fade(slashA);
|
||||
wait(10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
task Fade(int ID){
|
||||
|
||||
ObjMove_AddPatternA2(ID, 0, baseSpd/2, [rand(180, 230), rand(-50, 30)][rand_int(0, 1)], (-baseSpd/2)/(decelTime), 2, 0);
|
||||
|
||||
ascent(i in 0..(decelTime)){
|
||||
ObjRender_SetAlpha(ID, Interpolate_Accelerate(shotAlpha, 0, i/(decelTime)));
|
||||
yield;
|
||||
}
|
||||
|
||||
Obj_Delete(ID);
|
||||
|
||||
}
|
||||
|
||||
async{
|
||||
|
||||
ObjMove_SetAcceleration(slash, -baseSpd/decelTime);
|
||||
ObjMove_SetMaxSpeed(slash, baseSpd/50);
|
||||
ObjRender_SetAlpha(slash, shotAlpha);
|
||||
|
||||
ascent(i in 0..decelTime){
|
||||
ObjRender_SetScaleXYZ(slash, Interpolate_Accelerate(shotScaleSpecial/1.25, shotScaleSpecial, i/decelTime));
|
||||
yield;
|
||||
}
|
||||
|
||||
ascent(i in 0..(lifeTime-decelTime)){
|
||||
ObjRender_SetAlpha(slash, Interpolate_Accelerate(shotAlpha, 0, i/(lifeTime-decelTime)));
|
||||
yield;
|
||||
}
|
||||
|
||||
Obj_Delete(slash);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Bomb
|
||||
// Holy fuck its literally YoumuA IBP
|
232
script/player/Narumi/Player_Function_Laser.dnh
Normal file
232
script/player/Narumi/Player_Function_Laser.dnh
Normal file
|
@ -0,0 +1,232 @@
|
|||
|
||||
// Particle list for laser effect
|
||||
|
||||
int LaserEffect = ObjParticleList_Create(OBJ_PARTICLE_LIST_2D);
|
||||
int[] rect = [704, 192, 768, 256];
|
||||
|
||||
ObjPrim_SetTexture(LaserEffect, "script/player/Kouryuu/playerlib/PlSheet_Kouryuu.png");
|
||||
|
||||
Obj_SetRenderPriorityI(LaserEffect, 41);
|
||||
ObjPrim_SetPrimitiveType(LaserEffect, PRIMITIVE_TRIANGLELIST);
|
||||
ObjPrim_SetVertexCount(LaserEffect, 4);
|
||||
|
||||
ObjRender_SetBlendType(LaserEffect, BLEND_ADD_ARGB);
|
||||
|
||||
// Left-top, right-top, left-bottom, right-bottom
|
||||
|
||||
ObjPrim_SetVertexUVT(LaserEffect, 0, rect[0], rect[1]);
|
||||
ObjPrim_SetVertexUVT(LaserEffect, 1, rect[2], rect[1]);
|
||||
ObjPrim_SetVertexUVT(LaserEffect, 2, rect[0], rect[3]);
|
||||
ObjPrim_SetVertexUVT(LaserEffect, 3, rect[2], rect[3]);
|
||||
|
||||
// Vertex positions are offset with deltas so that the sprite is centered
|
||||
|
||||
float dU = (rect[2] - rect[0])/2;
|
||||
float dV = (rect[3] - rect[1])/2;
|
||||
|
||||
ObjPrim_SetVertexPosition(LaserEffect, 0, -dU, -dV, 1);
|
||||
ObjPrim_SetVertexPosition(LaserEffect, 1, dU, -dV, 1);
|
||||
ObjPrim_SetVertexPosition(LaserEffect, 2, -dU, dV, 1);
|
||||
ObjPrim_SetVertexPosition(LaserEffect, 3, dU, dV, 1);
|
||||
|
||||
ObjPrim_SetVertexIndex(LaserEffect, [0, 1, 2, 1, 2, 3]);
|
||||
|
||||
task _CreateLaserParticle(float x, float y, float spdX, float spdY, float baseAng){
|
||||
|
||||
int effectLength = 45;
|
||||
let x_speed = spdX;
|
||||
let y_speed = spdY;
|
||||
let z_add = rand(-5, 5);
|
||||
|
||||
ascent(i in 0..effectLength){
|
||||
_PetalMovement(Interpolate_Decelerate(1, 0.5, i/effectLength), Interpolate_Decelerate(255, 0, i/effectLength));
|
||||
yield;
|
||||
}
|
||||
|
||||
task _PetalMovement(scale, alpha){
|
||||
|
||||
ObjParticleList_SetScale(LaserEffect, scale);
|
||||
ObjParticleList_SetAngleZ(LaserEffect, baseAng);
|
||||
ObjParticleList_SetPosition(LaserEffect, x, y, 1);
|
||||
ObjParticleList_SetAlpha(LaserEffect, alpha);
|
||||
|
||||
//Submits the current data to an instance, cleared every frame.
|
||||
ObjParticleList_AddInstance(LaserEffect);
|
||||
|
||||
x += x_speed;
|
||||
y += y_speed;
|
||||
baseAng += z_add;
|
||||
|
||||
yield;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
task _LaserSpriteRender(
|
||||
img, int target, float targetAng,
|
||||
int rectLeft, int rectTop, int rectRight, int rectBottom,
|
||||
float scaleX, float scaleY, int renderPriority, float alpha,
|
||||
float scaleSpeed
|
||||
){
|
||||
|
||||
int[] EnemyList = [];
|
||||
let lasersprite = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
|
||||
float scaleXBoost = 0;
|
||||
float scaleXBoostMax = 0.05;
|
||||
float ang = 180;
|
||||
|
||||
ObjPrim_SetTexture(lasersprite, img);
|
||||
ObjSprite2D_SetSourceRect(lasersprite, rectLeft, rectTop, rectRight, rectBottom);
|
||||
ObjRender_SetScaleXYZ(lasersprite, 0, scaleY, 1);
|
||||
ObjSprite2D_SetDestRect(lasersprite, -(rectRight-rectLeft)/2, 0, (rectRight-rectLeft)/2, rectTop-rectBottom);
|
||||
Obj_SetRenderPriorityI(lasersprite, renderPriority);
|
||||
ObjRender_SetAlpha(lasersprite, 0);
|
||||
ObjRender_SetBlendType(lasersprite, BLEND_ADD_ARGB);
|
||||
|
||||
async{
|
||||
loop{
|
||||
|
||||
if(GetVirtualKeyState(VK_SHOT) != KEY_FREE && !ripplayer && IsPermitPlayerShot){
|
||||
|
||||
// Assumes the intersecting color is right next to the right of the original color
|
||||
|
||||
if (length(EnemyList) > 0) {ObjSprite2D_SetSourceRect(lasersprite, rectRight, rectTop, rectRight+(rectRight-rectLeft), rectBottom);}
|
||||
else{ObjSprite2D_SetSourceRect(lasersprite, rectLeft, rectTop, rectRight, rectBottom);}
|
||||
|
||||
float targetx = ObjRender_GetX(target);
|
||||
float targety = ObjRender_GetY(target);
|
||||
|
||||
ObjRender_SetScaleX(lasersprite, min(scaleX+scaleXBoost, ObjRender_GetScaleX(lasersprite) + scaleSpeed));
|
||||
scaleXBoost = scaleXBoostMax * sin(ang);
|
||||
|
||||
ObjRender_SetAlpha(lasersprite, min(alpha, ObjRender_GetAlpha(lasersprite)+alpha/5));
|
||||
ObjRender_SetAngleZ(lasersprite, targetAng);
|
||||
ObjRender_SetPosition(lasersprite, targetx, targety, 1);
|
||||
|
||||
ang += 25;
|
||||
|
||||
yield;
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
ObjRender_SetScaleX(lasersprite, max(0, ObjRender_GetScaleX(lasersprite) - scaleSpeed));
|
||||
ObjRender_SetAlpha(lasersprite, max(0, ObjRender_GetAlpha(lasersprite)-alpha/5));
|
||||
yield;
|
||||
}
|
||||
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function _RenderLaser(target, float ang, float maxintersectX, float maxLength, float width, float speedLength, float dmg){ /* */
|
||||
|
||||
int[] EnemyList = [];
|
||||
|
||||
float angRender = asin(maxintersectX/absolute(maxLength));
|
||||
//int laser = CreatePlayerShotA1(ObjRender_GetX(target), ObjRender_GetY(target), 0, ang, dmg, 9999999, 0);
|
||||
int laser = CreateStraightLaserA1(ObjRender_GetX(target), ObjRender_GetY(target), ang-90, maxLength, width, 99999999, 0, 1);
|
||||
ObjLaser_SetInvalidLength(laser, 0, 0);
|
||||
ObjShot_SetDamage(laser, dmg);
|
||||
ObjShot_SetAutoDelete(laser, false);
|
||||
Obj_SetRenderPriorityI(laser, plrender-1);
|
||||
_Follow(laser, target);
|
||||
|
||||
_LaserSpriteRender(
|
||||
plimg, laser, ang,
|
||||
256, 192, 384, 384,
|
||||
1, 20, plrender-1, shotAlpha,
|
||||
0.1
|
||||
);
|
||||
|
||||
// This also affects damage of the laser, not just effects
|
||||
LaserHitEffect(EnemyList, laser, dmg);
|
||||
|
||||
// When shot key is being held, create a line intersection that stretches across the laser.
|
||||
|
||||
/*
|
||||
Calculations:
|
||||
|
||||
startx: x of target
|
||||
|
||||
starty: y of target
|
||||
|
||||
endx: x of laser
|
||||
|
||||
endy: maxLength
|
||||
|
||||
width = width of laser
|
||||
*/
|
||||
async{
|
||||
|
||||
loop{
|
||||
|
||||
if(GetVirtualKeyState(VK_SHOT) != KEY_FREE && !ripplayer && IsPermitPlayerShot){
|
||||
|
||||
if(shotspeed % 5 == 0){
|
||||
ObjSound_Play(Base2);
|
||||
}
|
||||
|
||||
ObjShot_SetIntersectionEnable(laser, true);
|
||||
|
||||
//ObjShot_SetIntersectionLine(laser, ObjRender_GetX(target), ObjRender_GetY(target), ObjRender_GetX(target)+maxintersectX, -maxLength, width);
|
||||
//WriteLog(ObjMove_GetX(laserfwd));
|
||||
yield;
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
ObjShot_SetIntersectionEnable(laser, false);
|
||||
ObjShot_SetPenetration(laser, 99999999);
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// After shot key is released, let the laser leave and then delete it.
|
||||
|
||||
return laser;
|
||||
}
|
||||
|
||||
task LaserHitEffect(int[] EnemyList, int target, float basedmg){
|
||||
|
||||
async{
|
||||
loop{
|
||||
EnemyList = ObjCol_GetListOfIntersectedEnemyID(target);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
// Particle effects
|
||||
async{
|
||||
loop{
|
||||
ascent(i in -1..length(EnemyList)-1){
|
||||
_CreateLaserParticle(ObjMove_GetX(EnemyList[i])+prand(-30, 30), ObjMove_GetY(EnemyList[i])+prand(-30, 30), [prand(-8, -5), prand(-4, 4), prand(5, 8)][prand_int(0, 2)], [prand(-8, -6), prand(6, 8)][prand_int(0, 1)], rand(0, 360));
|
||||
}
|
||||
//Resort;
|
||||
//WriteLog(EnemyList);
|
||||
wait(rand_int(6, 9));
|
||||
}
|
||||
}
|
||||
|
||||
// Damage effects
|
||||
|
||||
}
|
||||
task _Follow(follower, followed){
|
||||
|
||||
while(!Obj_IsDeleted(follower)){
|
||||
float x = ObjRender_GetX(followed);
|
||||
float y = ObjRender_GetY(followed);
|
||||
ObjMove_SetPosition(follower, x, y);
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
354
script/player/Narumi/Player_Main.dnh
Normal file
354
script/player/Narumi/Player_Main.dnh
Normal file
|
@ -0,0 +1,354 @@
|
|||
#TouhouDanmakufu[Player]
|
||||
#ScriptVersion[3]
|
||||
#ID["PL_NARUMI"]
|
||||
#Title["Narumi Yatadera"]
|
||||
#Text["Player 0"]
|
||||
|
||||
//#Image["./mariremi_lib/mariremi_illust.png"]
|
||||
|
||||
#ReplayName["Narumi"]
|
||||
|
||||
#include "script/KevinSystem/kevin_system/Lib_Const.dnh"
|
||||
|
||||
#include "script/KevinSystem/Kevin_PlayerLib.txt"
|
||||
#include "script/KevinSystem/PlayerSoundLib.dnh"
|
||||
|
||||
#include "./Player_Function.dnh"
|
||||
#include "./Player_ShotConst.dnh"
|
||||
|
||||
#include "script/KevinSystem/kevin_system/Kevin_ItemConst.txt"
|
||||
#include "script/KevinSystem/kevin_system/Kevin_ItemLib.txt"
|
||||
|
||||
let csd = GetCurrentScriptDirectory();
|
||||
|
||||
// Global Variables
|
||||
|
||||
float maxX = GetStgFrameWidth();
|
||||
float maxY = GetStgFrameHeight();
|
||||
|
||||
// Images & Sound
|
||||
|
||||
let teamimg = csd ~ "./playerlib/Player_Sheet.png";
|
||||
LoadTextureEx(teamimg, true, true);
|
||||
//ObjRender_SetTextureFilterMip(teamimg, FILTER_LINEAR);
|
||||
|
||||
let plimg = csd ~ "./playerlib/PlSheet_Narumi.png";
|
||||
LoadTextureEx(plimg, true, true);
|
||||
ObjRender_SetTextureFilter(plimg, FILTER_NONE, FILTER_NONE, FILTER_NONE);
|
||||
|
||||
let sndpath = csd ~ "./sound";
|
||||
|
||||
int[] _enemyArray = [];
|
||||
int[] _existArray = [];
|
||||
int[] _shotArray = [];
|
||||
|
||||
bool isChain = false;
|
||||
bool isUseSpecialWpn = false;
|
||||
float curChain = 0;
|
||||
|
||||
// Other stuff
|
||||
|
||||
float playerX = 0;
|
||||
float playerY = 0;
|
||||
|
||||
let objPlayer = GetPlayerObjectID();
|
||||
int plrender = 42;
|
||||
|
||||
bool ripplayer = false;
|
||||
float shotspeed = 0;
|
||||
float bombrand = 0;
|
||||
|
||||
int grazecounter = 0; // For basic graze = PIV mechanic
|
||||
|
||||
int shotAlpha = (GetAreaCommonData("Config", "PlayerShotOpacity", 255)*0.01)*255;
|
||||
|
||||
float shotDamageOption = 4;
|
||||
float shotScaleOption = 1;
|
||||
|
||||
float shotDamageLaser = 2;
|
||||
float shotScaleLaser = 1;
|
||||
|
||||
float shotDamageSpecial = 5;
|
||||
float shotScaleSpecial = 1;
|
||||
|
||||
float[] PlayerSpd = [12, 6];
|
||||
|
||||
// Custom events for scoring mechanic
|
||||
|
||||
const EV_PIV_100 = EV_USER + 100i; // Normal enemies and nons
|
||||
const EV_PIV_250 = EV_USER + 101i; // Spells
|
||||
const EV_PIV_500 = EV_USER + 102i; // Last Spells
|
||||
const EV_PIV_2000 = EV_USER + 103i; // What.
|
||||
|
||||
@Initialize{
|
||||
|
||||
if(!IsCommonDataAreaExists("PIV")){
|
||||
CreateCommonDataArea("PIV");
|
||||
SetAreaCommonData("PIV", "currentvalue", 10000);
|
||||
SetAreaCommonData("PIV", "ChainAmount", 1);
|
||||
}
|
||||
else{}
|
||||
|
||||
SetPlayerStateEndEnable(true);
|
||||
|
||||
// Stuff
|
||||
Parameter();
|
||||
RenderPlayer();
|
||||
BaseShot();
|
||||
SpecialWeapon();
|
||||
|
||||
Obj_SetRenderPriorityI(objPlayer, 43);
|
||||
plrender = Obj_GetRenderPriorityI(objPlayer);
|
||||
_SoundTask();
|
||||
|
||||
//SetIntersectionVisualization(true); // Debug
|
||||
|
||||
_Mechanic(ripplayer, _enemyArray, _existArray, GetStgFrameWidth(), GetStgFrameHeight(), objPlayer, GetEnemyBossSceneObjectID(), 1, 2, 80);
|
||||
|
||||
_ShowChain();
|
||||
//_HandleChainGauge();
|
||||
|
||||
//_HitboxRender(ripplayer, objPlayer, plimg, teamimg, 768, 192, 832, 256, 1536, 896, 2048, 1408, 0.5, 0.65);
|
||||
SetShotAutoDeleteClip(96, 84, 96, 84);
|
||||
|
||||
_Countdown();
|
||||
|
||||
// Shot data loading
|
||||
LoadPlayerShotData(csd ~ "./Player_ShotData.dnh");
|
||||
}
|
||||
|
||||
@MainLoop{
|
||||
_enemyArray = GetIntersectionRegistedEnemyID;
|
||||
shotspeed += 1; // Managing the shot rate
|
||||
//_shotArray = GetAllShotID(TARGET_PLAYER);
|
||||
//UniversalAlphaHandle(_shotArray);
|
||||
plrender = Obj_GetRenderPriorityI(objPlayer);
|
||||
playerX = ObjMove_GetX(objPlayer);
|
||||
playerY = ObjMove_GetY(objPlayer);
|
||||
yield;
|
||||
}
|
||||
|
||||
@Event{
|
||||
alternative(GetEventType)
|
||||
|
||||
// Delete effect
|
||||
case(EV_DELETE_SHOT_PLAYER){
|
||||
|
||||
if(GetCommonDataPtr(EFFECTCUT_PTR, 0) >= 3){}
|
||||
|
||||
else{
|
||||
|
||||
let graphic = GetEventArgument(2);
|
||||
float[] position = GetEventArgument(1);
|
||||
|
||||
let obj = CreatePlayerShotA1(position[0], position[1], 0, ObjMove_GetAngle(GetEventArgument(0))+rand(-15, 15), 0, 99999, graphic);
|
||||
|
||||
ObjShot_SetIntersectionEnable(obj, false);
|
||||
_DeleteEffect(obj, 1);
|
||||
|
||||
}
|
||||
//if(graphic == ELECTRIC_FIRE_ALT) {_DeleteEffectAlt(obj);}
|
||||
//else{_DeleteEffect(obj);}
|
||||
}
|
||||
|
||||
// PIV-item spawning events
|
||||
case(EV_PIV_100){
|
||||
let arg = GetEventArgument(0);
|
||||
CreatePIVItem(PIV_100, arg[0], arg[1]);
|
||||
}
|
||||
|
||||
case(EV_PIV_250){
|
||||
let arg = GetEventArgument(0);
|
||||
CreatePIVItem(PIV_250, arg[0], arg[1]);
|
||||
}
|
||||
|
||||
case(EV_PIV_500){
|
||||
let arg = GetEventArgument(0);
|
||||
CreatePIVItem(PIV_500, arg[0], arg[1]);
|
||||
}
|
||||
|
||||
// Basic functionality events
|
||||
case(EV_REQUEST_SPELL){
|
||||
SetScriptResult(false);
|
||||
}
|
||||
|
||||
case(EV_HIT){
|
||||
|
||||
}
|
||||
|
||||
case(EV_CHAIN_MAX){
|
||||
|
||||
if(!isChain){
|
||||
ObjSound_Play(Shine);
|
||||
isChain = true;
|
||||
curChain = GetCommonDataPtr(POINTER_CHAIN, 1);
|
||||
}
|
||||
else{}
|
||||
|
||||
}
|
||||
|
||||
case(EV_CHAIN_RELEASE){
|
||||
|
||||
}
|
||||
|
||||
case(EV_CHAIN_END){
|
||||
|
||||
SetAreaCommonData("PIV", "ChainAmount", 1);
|
||||
isChain = false;
|
||||
|
||||
// Increase rank depending on curChain (>= 32), then reset curChain. MAX CHAIN increases rank by 0.4.
|
||||
|
||||
if(curChain >= 32){
|
||||
SetCommonData("Rank", clamp(GetCommonData("Rank", 1) + Interpolate_Linear(0.25, 0.5, curChain/64), GetCommonData("MinRank", 1), GetCommonData("MaxRank", 12)));
|
||||
}
|
||||
|
||||
curChain = 1;
|
||||
|
||||
}
|
||||
|
||||
case(EV_PLAYER_SHOOTDOWN){
|
||||
|
||||
ObjSound_Play(PlayerDie2);
|
||||
SetPlayerSpell(0);
|
||||
ripplayer = true;
|
||||
DeleteShotAll(TYPE_SHOT, TYPE_ITEM);
|
||||
SetCommonData("Rank", clamp(GetCommonData("Rank", 1) * 0.75, GetCommonData("MinRank", 1), GetCommonData("MaxRank", 12)));
|
||||
_DeathMove();
|
||||
|
||||
}
|
||||
|
||||
case(EV_PLAYER_REBIRTH){
|
||||
ripplayer = false;
|
||||
SetPlayerInvincibilityFrame(180);
|
||||
//_Countdown();
|
||||
_SigilCall(false, teamimg, 768+256, 512, 768+512, 768, objPlayer, 150);
|
||||
|
||||
}
|
||||
|
||||
case(EV_GRAZE){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Finalize{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Basic player parameters
|
||||
|
||||
task Parameter(){
|
||||
|
||||
// im trying to not be collected by the player but their item scope is dummy thicc and im alerted by its cheek
|
||||
SetPlayerItemScope(360);
|
||||
|
||||
SetPlayerLife(9); // Debug
|
||||
SetPlayerSpell(0);
|
||||
SetPlayerSpeed(PlayerSpd[0], PlayerSpd[1]); // (original: 5.25/2.0)
|
||||
SetPlayerRebirthFrame(0); // No bombs
|
||||
SetPlayerDownStateFrame(90);
|
||||
SetPlayerAutoItemCollectLine(GetStgFrameHeight/3);
|
||||
SetPlayerRebirthLossFrame(0);
|
||||
ObjPlayer_AddIntersectionCircleA1(objPlayer, 0, 0, 2, 40);
|
||||
|
||||
}
|
||||
|
||||
// Player render
|
||||
|
||||
task RenderPlayer(){
|
||||
|
||||
// Why is this movement code so cursed jesus fucking christ
|
||||
|
||||
float scale = 1; // Scalies
|
||||
int frame = 0;
|
||||
int spd = 12;
|
||||
int frame_hbox = 0;
|
||||
|
||||
ObjPrim_SetTexture(objPlayer, plimg);
|
||||
ObjSprite2D_SetSourceRect(objPlayer, 0, 0, 192, 192);
|
||||
ObjSprite2D_SetDestCenter(objPlayer);
|
||||
Obj_SetRenderPriorityI(objPlayer, plrender);
|
||||
ObjRender_SetScaleXYZ(objPlayer, scale, scale, 1);
|
||||
|
||||
int hitbox = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
|
||||
ObjPrim_SetTexture(hitbox, plimg);
|
||||
ObjSprite2D_SetSourceRect(hitbox, 384, 0, 448, 64);
|
||||
ObjSprite2D_SetDestCenter(hitbox);
|
||||
ObjRender_SetScaleXYZ(hitbox, scale, scale, 1);
|
||||
ObjRender_SetBlendType(hitbox, BLEND_ALPHA);
|
||||
Obj_SetRenderPriorityI(hitbox, 79);
|
||||
|
||||
Obj_SetVisible(hitbox, false);
|
||||
|
||||
// Lower "speed" parameter = FASTER SPEED
|
||||
|
||||
// FOR WHEN ONLY IDLE SPRITES ARE DONE
|
||||
|
||||
while(true){
|
||||
|
||||
frame++;
|
||||
frame_hbox++;
|
||||
|
||||
ObjRender_SetPosition(hitbox, playerX, playerY, 1);
|
||||
|
||||
if(ripplayer){
|
||||
ObjSprite2D_SetSourceRect(objPlayer, 0, 384, 192, 576);
|
||||
Obj_SetVisible(hitbox, false);
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
if(GetVirtualKeyState(VK_SLOWMOVE) != KEY_FREE){
|
||||
|
||||
ObjSprite2D_SetSourceRect(hitbox, 384+64*floor(frame_hbox/9), 0, 64+384+64*floor(frame_hbox/9), 64);
|
||||
Obj_SetVisible(hitbox, true);
|
||||
|
||||
_RenderPlayerMovement(objPlayer, frame, 0, 192, 192, 192, scale, 2, spd);
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
|
||||
_RenderPlayerMovement(objPlayer, frame, 0, 0, 192, 192, scale, 2, spd);
|
||||
|
||||
Obj_SetVisible(hitbox, false);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (frame >= (2*spd-1)){frame = 0;}
|
||||
if (frame_hbox >= (3*9-1)){frame_hbox = 0;}
|
||||
|
||||
yield;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
task _DeathMove(){
|
||||
|
||||
int afterimage = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
|
||||
ObjPrim_SetTexture(afterimage, plimg);
|
||||
ObjSprite2D_SetSourceRect(afterimage, 0, 384, 192, 576);
|
||||
ObjSprite2D_SetDestCenter(afterimage);
|
||||
ObjRender_SetBlendType(afterimage, BLEND_ALPHA);
|
||||
Obj_SetRenderPriorityI(afterimage, 40);
|
||||
|
||||
float[] curdest = [playerX, playerY];
|
||||
float[] dest = [clamp(playerX-256, 0, GetStgFrameWidth()), playerY];
|
||||
|
||||
SetPlayerRebirthPosition(dest[0], dest[1]);
|
||||
|
||||
ascent(i in 0..30){
|
||||
ObjRender_SetPosition(afterimage, Interpolate_Decelerate(curdest[0], dest[0], i/30), playerY, 1);
|
||||
yield;
|
||||
}
|
||||
|
||||
wait(60);
|
||||
|
||||
Obj_Delete(afterimage);
|
||||
|
||||
}
|
9
script/player/Narumi/Player_ShotConst.dnh
Normal file
9
script/player/Narumi/Player_ShotConst.dnh
Normal file
|
@ -0,0 +1,9 @@
|
|||
let current = GetCurrentScriptDirectory();
|
||||
let path = current ~ "Player_ShotData.dnh";
|
||||
LoadPlayerShotData(path);
|
||||
// -----
|
||||
|
||||
const AMULET = 1;
|
||||
const GOLEM = 2;
|
||||
|
||||
|
29
script/player/Narumi/Player_ShotData.dnh
Normal file
29
script/player/Narumi/Player_ShotData.dnh
Normal file
|
@ -0,0 +1,29 @@
|
|||
shot_image = "./playerlib/PlSheet_Narumi.png"
|
||||
|
||||
ShotData{
|
||||
id = 0 // Dummy
|
||||
rect = (0,0,0,0)
|
||||
render = ALPHA
|
||||
alpha = 0
|
||||
collision = 32
|
||||
}
|
||||
|
||||
// Fire
|
||||
|
||||
ShotData{
|
||||
id = 1
|
||||
rect = (640, 256, 768, 384)
|
||||
render = ALPHA
|
||||
alpha = 255
|
||||
collision = 64 // Hitbox of arrows is not centered on the sprite
|
||||
}
|
||||
|
||||
// Golem
|
||||
|
||||
ShotData{
|
||||
id = 2
|
||||
rect = (640, 0, 896, 256)
|
||||
render = ALPHA
|
||||
alpha = 255
|
||||
collision = 128 // Hitbox of arrows is not centered on the sprite
|
||||
}
|
0
script/player/Narumi/desc.txt
Normal file
0
script/player/Narumi/desc.txt
Normal file
BIN
script/player/Narumi/playerlib/PlSheet_Kouryuu.png
Normal file
BIN
script/player/Narumi/playerlib/PlSheet_Kouryuu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
BIN
script/player/Narumi/playerlib/PlSheet_Narumi.png
Normal file
BIN
script/player/Narumi/playerlib/PlSheet_Narumi.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
BIN
script/player/Narumi/playerlib/RAW/KouryuuPalette.aseprite
Normal file
BIN
script/player/Narumi/playerlib/RAW/KouryuuPalette.aseprite
Normal file
Binary file not shown.
BIN
script/player/Narumi/playerlib/RAW/soGay.aseprite
Normal file
BIN
script/player/Narumi/playerlib/RAW/soGay.aseprite
Normal file
Binary file not shown.
BIN
script/player/Narumi/playerlib/RAW/soTrue.aseprite
Normal file
BIN
script/player/Narumi/playerlib/RAW/soTrue.aseprite
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/CK Music Factory/air01.wav
Normal file
BIN
script/player/Narumi/sound/CK Music Factory/air01.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/CK Music Factory/air02.wav
Normal file
BIN
script/player/Narumi/sound/CK Music Factory/air02.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/CK Music Factory/laser01.wav
Normal file
BIN
script/player/Narumi/sound/CK Music Factory/laser01.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/CK Music Factory/slash01.wav
Normal file
BIN
script/player/Narumi/sound/CK Music Factory/slash01.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/CK Music Factory/wind01.wav
Normal file
BIN
script/player/Narumi/sound/CK Music Factory/wind01.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/TAM Music Factory/se04.wav
Normal file
BIN
script/player/Narumi/sound/TAM Music Factory/se04.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/TAM Music Factory/status4.wav
Normal file
BIN
script/player/Narumi/sound/TAM Music Factory/status4.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/TAM Music Factory/tama2.wav
Normal file
BIN
script/player/Narumi/sound/TAM Music Factory/tama2.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/bfxr_scythecall.wav
Normal file
BIN
script/player/Narumi/sound/bfxr_scythecall.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/bfxr_splash.wav
Normal file
BIN
script/player/Narumi/sound/bfxr_splash.wav
Normal file
Binary file not shown.
1
script/player/Narumi/sound/bfxr_teleporthigh.wav
Normal file
1
script/player/Narumi/sound/bfxr_teleporthigh.wav
Normal file
|
@ -0,0 +1 @@
|
|||
2,0.57,,0.3442,,0.2691,0.3,0.2179,,0.3445,,,,,,,,,,,0.2992,,0.5139,,,1,,,,,,,masterVolume
|
BIN
script/player/Narumi/sound/bfxr_teleportlow.wav
Normal file
BIN
script/player/Narumi/sound/bfxr_teleportlow.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/bfxr_watershoot.wav
Normal file
BIN
script/player/Narumi/sound/bfxr_watershoot.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/birdcall05.wav
Normal file
BIN
script/player/Narumi/sound/birdcall05.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/hit01.wav
Normal file
BIN
script/player/Narumi/sound/hit01.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/laser01.wav
Normal file
BIN
script/player/Narumi/sound/laser01.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/magic21.wav
Normal file
BIN
script/player/Narumi/sound/magic21.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/retrolaser.wav
Normal file
BIN
script/player/Narumi/sound/retrolaser.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/slash01.wav
Normal file
BIN
script/player/Narumi/sound/slash01.wav
Normal file
Binary file not shown.
BIN
script/player/Narumi/sound/tama2.wav
Normal file
BIN
script/player/Narumi/sound/tama2.wav
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue