I spent an hour learning how to Git. Help
|
@ -0,0 +1,109 @@
|
|||
Game Description (on Game Page):
|
||||
|
||||
[The Japanese description is translated using DeepL. I am sorry for any mistakes.]
|
||||
|
||||
ENGLISH:
|
||||
|
||||
A fan-made side story to the brand new instalment of Touhou Project, “100th Black Market”, starring the heroic Chimata Tenkyuu.
|
||||
|
||||
A black market at the Scarlet Devil Mansion has opened up! Play as the market god and face the mischievous vampire using the cards for wicked purposes!
|
||||
|
||||
Controls:
|
||||
|
||||
Z (Hold): Shoot/Confirm
|
||||
X: Use Spell Card (limited use)/Cancel
|
||||
Esc: Pause Game
|
||||
Esc+R: Quick Retry
|
||||
Esc+Q: Quick Exit to Title
|
||||
|
||||
See config.exe to rebind keys.
|
||||
|
||||
Credits:
|
||||
|
||||
Game Programmer & Designer
|
||||
Graphic Design & Artwork
|
||||
Kevin Minh (@kevinminh_alt)
|
||||
|
||||
Additional Artwork
|
||||
Aqwa (@aqwwa58)
|
||||
Schmagons
|
||||
|
||||
Composer (Boss Theme)
|
||||
Yal (@GameDevYal)
|
||||
|
||||
JAPANESE:
|
||||
|
||||
東方Projectの完全新作「100番目の闇市」のファンメイドサイドストーリーで、主人公の「天弓千亦」が主演します。
|
||||
|
||||
紅魔館に闇市が開かれた!?マーケットの神様として、カードを悪用する吸血鬼に立ち向かえ!
|
||||
|
||||
操作方法
|
||||
|
||||
Z (ホールド): 撃つ/確認する
|
||||
X: スペルカード使用(使用制限あり/キャンセル
|
||||
Esc: ゲームの一時停止
|
||||
Esc+R: クイックリトライ
|
||||
Esc+Q: タイトル画面でクイック終了
|
||||
|
||||
キーのリバインドはconfig.exeを参照してください。
|
||||
|
||||
クレジット
|
||||
|
||||
ゲームプログラマー&デザイナー
|
||||
グラフィックデザイン&アートワーク
|
||||
Kevin Minh (@kevinminh_alt)
|
||||
|
||||
追加アートワーク
|
||||
Aqwa (@aqwwa58)
|
||||
Schmagons
|
||||
|
||||
作曲家 (ボスのテーマ)
|
||||
Yal (@GameDevYal)
|
||||
|
||||
[INSERT JP TRANSLATION HERE]
|
||||
|
||||
——
|
||||
|
||||
Game Manual (preferably in-game, but may probably be transferred into a separate text file if I run out of time)
|
||||
|
||||
ENGLISH:
|
||||
|
||||
1. Gameplay
|
||||
|
||||
This is an exciting shooting game like a Touhou game.
|
||||
Play as Chimata Tenkyuu and use your clever dodging and shooting to defeat Remilia Scarlet’s relentless attacks!
|
||||
(Also, try obtaining a high score!)
|
||||
|
||||
2. Controls:
|
||||
|
||||
Z (Hold): Shoot/Confirm
|
||||
X: Use Spell Card (limited use)/Cancel
|
||||
Esc: Pause Game
|
||||
Esc+R: Quick Retry
|
||||
Esc+Q: Quick Exit to Title
|
||||
|
||||
See config.exe to rebind keys.
|
||||
|
||||
3. Gameplay Guide: Player
|
||||
|
||||
This time around, taking inspiration from her own spellcard “Danmaku Asylum”, Chimata has packed a lot (a lot) of knives on her adventure.
|
||||
|
||||
Her unfocused shot is a wide spread of knives that covers the entire screen. It deals a lot of damage if you hit an enemy with all the knives!
|
||||
Her focused shot has knives that are weaker, but they will automatically aim at the enemy.
|
||||
Her bomb is a simple “Lunar Shield” that clears bullets and deals damage. It follows her while active.
|
||||
|
||||
4. Gameplay Guide: Boss
|
||||
|
||||
Remilia has three nonspells and three spells this time around.
|
||||
Her attacks are based on her and others’ Ability Cards, so she’ll be using some very familiar patterns.
|
||||
But that can’t stop you, right?
|
||||
|
||||
5. Gameplay Tips
|
||||
|
||||
+ Bosses drop rainbow point items after every attack if you defeat them without losing a life. If you lose a life, they’ll just drop normal blue point items which are worth fewer points. Try your best to survive and score high!
|
||||
+ Pink petals, which are dropped by the boss, add 0.2x to your score multiplier.
|
||||
+ The closer you are to the boss, the faster petals will drop. Therefore, playing risky can help you earn more points!
|
||||
+ Don’t forget to use your bombs often! You get three every life.
|
||||
+ You can set the number of starting lives, player shot opacity, item opacity and background opacity in the Options menu.
|
||||
|
||||
JAPANESE:
|
|
@ -0,0 +1,550 @@
|
|||
A mostly-complete history log of engine updates can be found here.
|
||||
|
||||
1.32b
|
||||
Changes:
|
||||
- All functions and actions that change a shot's graphic ID has an additional feature:
|
||||
- The actual graphic ID will be the absolute value of the value received.
|
||||
- If the value received was negative, the graphic change operation will preserve the shot's previous spin angular velocity and Z-angle.
|
||||
- Affected functions and actions:
|
||||
- ObjShot_SetGraphic
|
||||
- ObjMove_AddPatternA3
|
||||
- ObjMove_AddPatternA4
|
||||
- ObjMove_AddPatternB3
|
||||
- ObjMove_AddPatternC3
|
||||
- ObjMove_AddPatternC4
|
||||
- TRANSFORM_GRAPHIC_CHANGE
|
||||
Additions:
|
||||
- Added an instruction on how to get ph3sx to work with Wine. (Check readme.txt)
|
||||
- Added SetIntersectionVisualizationRenderPriority.
|
||||
Bug fixes:
|
||||
- Fixed incorrect documentation for some functions.
|
||||
- Fixed AddPoint not working correctly.
|
||||
- Fixed some issues with acceleration and max speed when converting from B-movement to A-movement or C-movement with AddPattern.
|
||||
|
||||
1.32a
|
||||
Changes:
|
||||
- Renamed "real" to "float".
|
||||
- r (number suffix) -> f (number suffix)
|
||||
- 45.22r -> 45.22f
|
||||
- real -> float
|
||||
- as_real -> as_float
|
||||
- as_real_array -> as_float_array
|
||||
- VAR_REAL -> VAR_FLOAT
|
||||
- Changed how setting curvy laser node widths work. Instead of directly setting the width, the functions will set the nodes' width scales.
|
||||
- Renamed ObjCrLaser_SetNodeWidth to ObjCrLaser_SetNodeWidthScale.
|
||||
- Renamed ObjCrLaser_GetNodeWidth to ObjCrLaser_GetNodeWidthScale.
|
||||
- Improved cross-compatibility between different movement types of the following functions:
|
||||
- ObjMove_SetSpeed
|
||||
- ObjMove_SetAngle
|
||||
- ObjMove_SetAcceleration
|
||||
- ObjMove_SetMaxSpeed
|
||||
- ObjMove_SetAngularVelocity
|
||||
- Swapped the "shot graphic ID" and "target ID" arguments in ObjMove_AddPatternA4.
|
||||
- Swapped the "max speed" and "angular velocity" arguments of the following functions:
|
||||
- ObjMove_AddPatternA2
|
||||
- ObjMove_AddPatternA3
|
||||
- ObjMove_AddPatternA4
|
||||
- TRANSFORM_ADDPATTERN_A2 in ObjPatternShot transforms
|
||||
- Completely removed shot scripts.
|
||||
- Moved SetShotDeleteEventEnable to the stage script.
|
||||
- Default values for all three delete events are true.
|
||||
- Furthermore, fixed EV_DELETE_SHOT_IMMEDIATE and EV_DELETE_SHOT_FADE not being notified properly.
|
||||
- Restructed event arguments of EV_DELETE_SHOT_TO_ITEM.
|
||||
- The third event argument; "player collision", has been removed.
|
||||
- Collision with the player will now trigger EV_DELETE_SHOT_IMMEDIATE instead of EV_DELETE_SHOT_TO_ITEM.
|
||||
- Increased the minimum width for straight and curve lasers, primarily for delay visibility purposes. (Thanks to Naudiz)
|
||||
- Allowed lasers to lose penetration (life) points. (Thanks to Naudiz)
|
||||
- Like with any shot object, this will only occur when a laser lacks spell resistance (which it has by default).
|
||||
- Removed #BGM.
|
||||
- Made it so that the window sizes list will be autogenerated instead of defaulting to [640x480, 800x600, 960x720, 1280x960] when window.size.list in th_dnh.def doesn't exist.
|
||||
- Size multipliers are [x1, x1.25, x1.5, x2], with screen.width and screen.height being the base resolution.
|
||||
- Made it so that the engine will check for the required .dll modules during initialization.
|
||||
- d3d9.dll
|
||||
- d3dx9_43.dll
|
||||
- d3dcompiler_43.dll
|
||||
- dinput8.dll
|
||||
- dsound.dll
|
||||
- In the event where the Direct3D device enters a lost state, the engine will now attempt to restore up to 60 times before throwing an error, rather than only once.
|
||||
- Removed ObjItem_SetAutoCollectEnable, and replaced it with ObjItem_SetAutoCollectEnableFlags.
|
||||
Additions:
|
||||
- Added Interpolate_X_Array, Interpolate_X_Angle, and Interpolate_X_AngleR. (Thanks to Naudiz)
|
||||
- Added ObjShot_SetEnemyIntersectionInvalidFrame and ObjShot_SetPenetrateShotEnable. (Thanks to Naudiz)
|
||||
- Added SetShotTextureFilter, SetItemTextureFilter, ObjRender_SetTextureFilter, and ObjShot_SetAngleRounding. (Thanks to Naudiz)
|
||||
- Added SetEnemyAutoDeleteClip, ObjEnemy_SetAutoDelete, and ObjEnemy_SetDeleteFrame. (Thanks to NicholasLogan)
|
||||
- Added ObjMove_SetAngularAcceleration, ObjMove_SetAngularMaxVelocity, and ObjMove_AddPatternA5. (Thanks to NicholasLogan)
|
||||
- Added an overload to CreateShotA2, adding an angular velocity argument in between the acceleration and max speed ones. (Thanks to Naudiz)
|
||||
- Added ObjMove_GetMovementType. (Thanks to Naudiz)
|
||||
- Added constants:
|
||||
- MOVE_NONE
|
||||
- MOVE_ANGLE
|
||||
- MOVE_XY
|
||||
- MOVE_XY_ANGLE
|
||||
- MOVE_LINE
|
||||
- Added the C-movement type for ObjMove. (Thanks to Naudiz)
|
||||
- CreateShotC1
|
||||
- CreateShotC2
|
||||
- CreateShotOC1
|
||||
- ObjMove_AddPatternC1
|
||||
- ObjMove_AddPatternC2
|
||||
- ObjMove_AddPatternC3
|
||||
- Added AddPattern functions for line-movement. (Thanks to Naudiz)
|
||||
- ObjMove_AddPatternD1 (AddPattern version of ObjMove_SetDestAtSpeed)
|
||||
- ObjMove_AddPatternD2 (AddPattern version of ObjMove_SetDestAtFrame)
|
||||
- ObjMove_AddPatternD3 (AddPattern version of ObjMove_SetDestAtWeight)
|
||||
- Added ObjMove_CancelMovement.
|
||||
- Added new transformations to pattern shot objects. (Thanks to Naudiz)
|
||||
- TRANSFORM_ADDPATTERN_C1
|
||||
- TRANSFORM_ADDPATTERN_C2
|
||||
- Added psrand.
|
||||
- Added array overloads to the following functions:
|
||||
- ObjSprite2D_SetSourceRect
|
||||
- ObjSprite2D_SetDestRect
|
||||
- ObjSpriteList2D_SetSourceRect
|
||||
- ObjSpriteList2D_SetDestRect
|
||||
- ObjSprite3D_SetSourceRect
|
||||
- ObjSprite3D_SetDestRect
|
||||
- ObjSprite3D_SetSourceDestRect
|
||||
- Added support for hexadecimal numbers in text color tags.
|
||||
- "[f tc=0xffffff]" is equivalent to "[f tc=(255,255,255)]".
|
||||
- Added GetWorkingDirectory.
|
||||
- Added an option to allow the engine to keep running while the window is unfocused. (Thanks to Naudiz)
|
||||
- Added SetEnableUnfocusedProcessing and IsWindowFocused.
|
||||
- Added the property "unfocused.processing" to th_dnh.def.
|
||||
- Added EV_APP_LOSE_FOCUS and EV_APP_RESTORE_FOCUS.
|
||||
- Added exponent format for numbers.
|
||||
- "5.462e3" or "-231.9e-2" are now valid numbers.
|
||||
- Added ObjItem_SetAutoCollectEnableFlags.
|
||||
- ITEM_AUTOCOLLECT_PLAYER_SCOPE
|
||||
- ITEM_AUTOCOLLECT_COLLECT_ALL
|
||||
- ITEM_AUTOCOLLECT_POC_LINE
|
||||
- ITEM_AUTOCOLLECT_COLLECT_CIRCLE
|
||||
- ITEM_AUTOCOLLECT_ALL
|
||||
- Added an overload to atoi.
|
||||
- Added SetScore, SetGraze, and SetPoint.
|
||||
Bug fixes:
|
||||
- Fixed .dat archives not working.
|
||||
- Fixed incorrect null checks, resulting in the game crashing when trying to operate on a null value.
|
||||
- For example, using Obj_GetValue on a non-existent key will yield a null value.
|
||||
- Fixed a crash bug which may sometimes happen when trying to parse a script file that ends with a line comment.
|
||||
- Fixed ObjMove_AddPatternXX's shot graphic change not working with loose and curvy lasers.
|
||||
- Fixed SetShotIntersectionCircle/Line not registering intersection, despite showing up in intersection visualization.
|
||||
|
||||
1.31b
|
||||
Bug fixes:
|
||||
- Fixed a bug where the game would freeze when compiling a script with a syntax error.
|
||||
- Fixed a minor visual bug where the LogWindow's sub-info fields would all try to display over each other on initialization.
|
||||
|
||||
1.31a
|
||||
Changes:
|
||||
- This version breaks replay, common data, and .dat archive backwards compatibility.
|
||||
- Replaced the default script select backgrounds with a radder version. (Thanks to Naudiz)
|
||||
- Renamed GetShotIdAll to GetAllShotID.
|
||||
- Changed the text representation of script value types in error messages.
|
||||
- "real-array-array" -> "real[][]"
|
||||
- Script matrix functions can now take in a 4x4 array instead of only a 1x16 array previously.
|
||||
- The element type is also no longer limited to real.
|
||||
- Made setting ObjRender_SetEnableDefaultTransformMatrix to false still load the camera matrix.
|
||||
- Allowed multiple ObjSounds to independently stream the same sound file.
|
||||
- Shortened the module directory in Log messages of the LogWindow to "../".
|
||||
- Removed the behaviour where the 2D and 3D camera resets upon transitioning from the package scene to the stage scene.
|
||||
- Fog data is no longer split between package-level and stage-level scripts.
|
||||
- The default FPS counter no longer briefly appears when starting with package.script.main.
|
||||
- Maximizing the window now triggers fullscreen mode.
|
||||
- Objects now have separate tables each for string-indexed and int-indexed.
|
||||
- Improved support for particle list objects for older PCs.
|
||||
- Made it so that curvy lasers can be shortened. (Thanks to Naudiz)
|
||||
- ObjFileT_SplitLineText now splits from pattern rather than from a list of delimiters.
|
||||
- Reduced the float truncation epsilon. (0.01 -> 0.000001)
|
||||
- #include in shader source files now behaves like regular script includes.
|
||||
- Normal shot objects can now have multiple hitboxes again.
|
||||
- Change loose and curvy lasers behaviour when delay motion is enabled. (Thanks to Naudiz)
|
||||
- Text objects can now be centered around their object positions. No need to use ObjText_SetMaxWidth for that anymore. (Thanks to Naudiz)
|
||||
Additions:
|
||||
- Added missing function documentation for GetAllEnemyID.
|
||||
- Added an overload each for Rotate2D and Rotate3D, taking in the rotation origin point.
|
||||
- Expanded the variety of intersection-checking functions:
|
||||
- IsIntersected_Point_Polygon
|
||||
- IsIntersected_Point_Circle
|
||||
- IsIntersected_Point_Ellipse
|
||||
- IsIntersected_Point_Line
|
||||
- IsIntersected_Point_RegularPolygon
|
||||
- IsIntersected_Circle_Polygon
|
||||
- IsIntersected_Circle_Circle
|
||||
- IsIntersected_Circle_Ellipse
|
||||
- IsIntersected_Circle_RegularPolygon
|
||||
- IsIntersected_Line_Polygon
|
||||
- IsIntersected_Line_Circle
|
||||
- IsIntersected_Line_Ellipse
|
||||
- IsIntersected_Line_Line
|
||||
- IsIntersected_Line_RegularPolygon
|
||||
- IsIntersected_Polygon_Polygon
|
||||
- IsIntersected_Polygon_Ellipse
|
||||
- IsIntersected_Polygon_RegularPolygon
|
||||
- Added ReflectAngle and ReflectAngleR. (Thanks to Naudiz)
|
||||
- Added Python-style reverse indexing of arrays. (Thanks to Naudiz)
|
||||
- See "New Scripting Features".
|
||||
- arr[-n] is equivalent to arr[length(arr) - n]
|
||||
- Also works in erase and insert.
|
||||
- Added replace and remove. (Thanks to Naudiz)
|
||||
- #ifdef, #ifndef, #else, and #endif preprocessor directives for scripts.
|
||||
- Several script macros were added:
|
||||
- _DNH_PH3SX_
|
||||
- SCRIPT_PACKAGE (defined in package-level scripts)
|
||||
- SCRIPT_STAGE (defined in stage-level scripts)
|
||||
- #define is not yet supported.
|
||||
- Added ObjItem_GetIntersectionEnable. (Thanks to Naudiz)
|
||||
- Added ObjRender_GetColorHex, ObjPrim_GetVertexColorHex, and ObjCrLaser_GetNodeColorHex. (Thanks to Naudiz)
|
||||
- Added ColorHexRGBtoHSV.
|
||||
- Added another event argument to EV_DELETE_SHOT_PLAYER.
|
||||
- Added a "Sound Memory" display to the Sound tab of the LogWindow.
|
||||
- Added INFO_IS_REQUIRE_ALL_DOWN to ObjEnemyBossScene_GetInfo. (Thanks to Naudiz)
|
||||
- Added ObjEnemy_SetMaximumDamage and ObjEnemy_AddLifeEx.
|
||||
- Added INFO_DAMAGE_PREVIOUS_FRAME to ObjEnemy_GetInfo.
|
||||
- Added ObjText_SetFixedWidth.
|
||||
- Added ObjText_GetText. (Thanks to Naudiz)
|
||||
- Added ObjText_SetVerticalAlignment. (Thanks to Naudiz)
|
||||
- Added ObjCrLaser_SetTipCapping, ObjCrLaser_GetNodeRenderWidth, and ObjCrLaser_SetNodeRenderWidth. (Thanks to Naudiz)
|
||||
- Added overloads to ObjCrLaser_SetNode and ObjCrLaser_AddNode. (Thanks to Naudiz)
|
||||
- Added ObjShot_SetFixedAngle and ObjShot_SetDelayAngularVelocity. (Thanks to Naudiz)
|
||||
- Added SplitString2.
|
||||
- Added Obj_GetValueCount and Obj_GetValueCountI.
|
||||
- Added a progress bar to the FileArchiver.
|
||||
- Added an overload to SetStgFrame. (Thanks to Naudiz)
|
||||
- Added GetConfigVirtualKeyMapping and GetVirtualKeyMapping. (Thanks to Naudiz)
|
||||
Bug fixes:
|
||||
- Fixed incorrect documentation of IsIntersected_Circle_RegularPolygon.
|
||||
- Fixed the Y shot intersection scale not functioning properly on loose lasers.
|
||||
- Fixed the engine crashing upon trying to parse an excess comma in function parameter lists.
|
||||
- Fixed type-checking bugs with array-index-assignment operations.
|
||||
- Fixed an issue where the parser would indefinitely hang upon trying to parse an ill-formed for-loop.
|
||||
- Fixed a bug where .wav files over 1MB large would get cut off at the end.
|
||||
- Fixed a bug where multiple streaming ObjSounds playing the same file would not function correctly.
|
||||
- Fixed ObjSound_IsPlaying returning false if called in the same frame of ObjSound_Play.
|
||||
- Fixed a bug where shot objects colliding with the player gets deleted before EV_HIT is notified.
|
||||
- Fixed GetShotIdInCircleA1 incorrectly returning player shot IDs instead of enemy shot IDs.
|
||||
- Fixed ObjShot_Regist in a player script returning null if IsPermitPlayerShot is true.
|
||||
- Fixed a bug where the shot object colliding with the player is deleted before the notification of EV_HIT.
|
||||
- Fixed off-centered shot and item graphics.
|
||||
- Fixed the game crashing upon trying to parse an ill-formed argument list in user shot/item data files.
|
||||
- Fixed a bug where 3D render objects drawn below the min STG frame render priority would get abnormally stretched out.
|
||||
- Fixed ObjMove_GetSpeedX/Y returning incorrect values for ObjMove_SetDestAtXXX functions.
|
||||
- Fixed the game crashing when setting ObjRender_SetEnableDefaultTransformMatrix to false for 3D objects.
|
||||
- Fixed incorrect conversion of A-movement to B-movement for ObjMove.
|
||||
- Fixed CreateItemU1/2 causing the created item to render at (0, 0) for a single frame. (Thanks to Naudiz)
|
||||
- Fixed ObjMove_AddPatternXX not working on move objects that do not have an existing movement pattern. (Thanks to Naudiz)
|
||||
- Fixed a rare bug with array initialization.
|
||||
- Fixed a bug where ObjShot_SetPenetration(obj, 0) would not notify EV_DELETE_SHOT_PLAYER.
|
||||
- Fixed a rare crash during enemy boss scene loading.
|
||||
- Fixed a bug where the game would freeze when trying to restart the stage scene in a package script while an enemy boss scene hasn't finished loading.
|
||||
- Fixed a rare crash with script object deletion.
|
||||
|
||||
1.30a:
|
||||
Changes:
|
||||
- Greatly improved the speed of the script code interpreter.
|
||||
- Made the maximum sizes of render targets respect the Direct3D device capabilities.
|
||||
- EV_REQUEST_LIFE now accepts all types of values (will be converted to reals).
|
||||
- In case that an array was passed (multiple bosses), each elements will also be converted to reals.
|
||||
- Direct3D device capabilities will now be checked at the start, and the user will be notified if they are insufficient to run the engine.
|
||||
- Changed the default render priority of items to 40. (Previously 60, what the fuck mkm)
|
||||
- Changed the behaviour of resource pre-loading. (LoadTexture, LoadMesh, etc.)
|
||||
- Loaded resources are no longer script-dependent, they will remain loaded even if the script that loaded them has been closed.
|
||||
- Changed the arguments of ObjPatternShot_AddTransform/ObjPatternShot_SetTransform.
|
||||
- Additionally, the above two functions now take in varargs.
|
||||
- Improved GetObjectDistance.
|
||||
- Introduced the ability to use StartScript a second time without having to use LoadScript again.
|
||||
- Renamed ObjSound_SetRestartEnable to ObjSound_SetResumeEnable.
|
||||
- Usage unchanged.
|
||||
- Rearranged the arguments of ObjPatternShot_Add/SetTransform.
|
||||
- ObjFile_Store now use the source file's original line endings.
|
||||
- Binary, octal, and hexadecimal number literals now default to int.
|
||||
- Changed the usage of the function "resize".
|
||||
- Improved the speed of boss scene scripts loading.
|
||||
Additions:
|
||||
- Many new additions to the scripting language.
|
||||
- See "New Scripting Features".
|
||||
- Added GetObjectDistanceSq and GetObjectDeltaAngle.
|
||||
- Added an overload each for GetCommonData and GetAreaCommonData.
|
||||
- Added GetSystemTimeMilliS and GetSystemTimeNanoS.
|
||||
- Added SetInvalidPositionReturn, a function for changing the "invalid position" from (0, 0).
|
||||
- Added functions for pointer-based common data access:
|
||||
- LoadCommonDataValuePointer
|
||||
- LoadAreaCommonDataValuePointer
|
||||
- IsValidCommonDataValuePointer
|
||||
- SetCommonDataPtr
|
||||
- GetCommonDataPtr
|
||||
- Added IsVertexShaderSupported.
|
||||
- Added the ability to set the read offset of .dat archives.
|
||||
- Added new ObjPatternShot transforms:
|
||||
- TRANSFORM_ADDPATTERN_B1
|
||||
- TRANSFORM_ADDPATTERN_B2
|
||||
- Renamed TRANSFORM_ADDPATTERNA1 to TRANSFORM_ADDPATTERN_A1
|
||||
- Renamed TRANSFORM_ADDPATTERNA2 to TRANSFORM_ADDPATTERN_A2
|
||||
- Added new ObjPatternShot patterns: (thanks to Naudiz)
|
||||
- PATTERN_LINE
|
||||
- PATTERN_ROSE
|
||||
- Added back in script source caching, plus the ability to remove a script from the cache.
|
||||
- Added ObjEnemyBossScene_SetUnloadCache.
|
||||
- Added a "Cached Scripts" panel to the Script tab of the LogWindow.
|
||||
- Added a "CPU Time" column to the Script tab of the LogWindow.
|
||||
- Added a "Shader" tab to the LogWindow.
|
||||
- Added an overload for ColorARGBToHex.
|
||||
- Added ObjItem_SetPositionRounding.
|
||||
- Added new maths functions:
|
||||
- log2
|
||||
- logn
|
||||
- erf
|
||||
- gamma
|
||||
- distance
|
||||
- distancesq
|
||||
- dottheta
|
||||
- rdottheta
|
||||
- cbrt
|
||||
- AngularDistance
|
||||
- AngularDistanceR
|
||||
- Rotate2D
|
||||
- Rotate3D
|
||||
- Added count_rand, count_prand, reset_count_rand, and reset_count_prand.
|
||||
- Added Interpolate_X and Interpolate_X_PackedInt.
|
||||
- Added GetScriptStatus.
|
||||
- STATUS_LOADING
|
||||
- STATUS_LOADED
|
||||
- STATUS_RUNNING
|
||||
- STATUS_PAUSED
|
||||
- STATUS_CLOSING
|
||||
- STATUS_INVALID
|
||||
- Added implicit array casting for initialization, assignment, and concatenation.
|
||||
- Only applicable for int[] <-> real[] <-> null
|
||||
- Added array casting functions:
|
||||
- as_int_array
|
||||
- as_real_array
|
||||
- as_bool_array
|
||||
- as_char_array
|
||||
- as_x_array
|
||||
- Added StringFormat, a string formatting function in the style of C's sprintf.
|
||||
- Added IsIntersected_Circle_RegularPolygon and IsIntersected_Circle_Ellipse.
|
||||
- Added new array functions: contains, insert.
|
||||
- Added ObjRender_SetEnableDefaultTransformMatrix.
|
||||
- Added ObjPrim_GetTexture.
|
||||
Bug fixes:
|
||||
- Fixed LoadMesh crashing the engine.
|
||||
- Fixed ObjCol_GetListOfIntersectedShotID incorrectly expecting only 1 argument.
|
||||
- Fixed a bug where whitespaces in parameter lists in text object tags are incorrectly parsed.
|
||||
- Fixed a bug where the "Show LogWindow" option would disappear if the game was set to start in (borderless) fullscreen mode.
|
||||
- Fixed the sound streamer behaving incorrectly when playing a .wav file larger than 1MB a second time.
|
||||
- Fixed a bug where ObjSound_Seek would be ineffectual if used when the sound isn't playing or within 2 frames after being played.
|
||||
- Fixed the Y hitbox scale not affecting the hitboxes of laser objects.
|
||||
- Fixed the LogWindow not able to output logs to file.
|
||||
- Fixed a bug where penetrating player shots may randomly not correctly collide with enemy hitboxes and mess up replays.
|
||||
- Fixed the engine crashing if the stage scene is quit and there is an ObjPatternShot, whose parent is a dead boss object, that wasn't manually deleted.
|
||||
- Fixed the LogWindow's Log tab not horizontally scrolling the newest line into view.
|
||||
- Fixed a bug with the remainder operation where using (kn % -n) or (-kn % n) where (k) is an integer results in (-n).
|
||||
- Fixed crash bugs with ternary statements in the following cases:
|
||||
- let a = [condition ? 0 : 1];
|
||||
- a[condition ? 0 : 1] = 100;
|
||||
- Fixed a package crash that happens when LoadScriptInLoadThread loads a stage script that contains a parser error.
|
||||
- Fixed a bug that made variable-overshadowing a function throw a parser error.
|
||||
- let power = 100; //This is possible again.
|
||||
- Fixed a bug where an ObjMove would lag for one frame after applying its last AddPattern transform.
|
||||
- Fixed a "feature" where a multidimensional array can host values of different types.
|
||||
- Fixed a bug where Windows' list-searching feature was interfering with key remapping in the config.
|
||||
- Fixed a bug where empty lines in text file object are skipped over in some devices.
|
||||
- Fixed ObjFileT_SplitLineText having an incorrect return value if the object is invalid.
|
||||
- Fixed an issue where the engine's default 3D render shader and 3D particle list shader don't work on AMD graphics cards.
|
||||
- Also updated the shader source files in the sample scripts with this fix.
|
||||
- Fixed a null pointer read crash bug during engine initialization.
|
||||
- Fixed a bug where short-circuited logical expressions would not convert to boolean.
|
||||
|
||||
1.21a:
|
||||
- Fixed MatrixMultiply and MatrixDivide functioning incorrectly.
|
||||
- Added MatrixTransformVector for transforming a Vector3 by a transformation matrix.
|
||||
- Added a hex overload for SetFogParam.
|
||||
- Added a floored division operation. ("~/" and "~/=")
|
||||
- Added "resize", a function for resizing arrays.
|
||||
- Modified the functionality of the array slice operation and operator.
|
||||
- Upper slice bound is automatically capped at the array's size.
|
||||
- More options for text object tags.
|
||||
- Increased the smoothness of rendered fonts.
|
||||
- Fixed SetShotIntersectionCircle and SetShotIntersectionLine not working.
|
||||
- Fixed a memory leak issue that was causing the "too many open files" error message.
|
||||
- Using ObjRender_SetAlpha on a 2D sprite list object whose vertices were closed will now have an alpha-multiply effect.
|
||||
- Optimizations.
|
||||
|
||||
1.20b:
|
||||
- Fixed a bug that caused for loops using new variables to not function correctly.
|
||||
- Fixed a bug that caused all GetColor functions to return incorrect values. (Including GetShotDataInfoA1)
|
||||
- Fixed a bug where off-centered player hitboxes would behave strangely.
|
||||
- Fixed the game crashing on script end/retry. (How the fuck did I not notice this before 1.20a release bloody hell)
|
||||
- Added ObjShot_SetSpinAngularVelocity.
|
||||
|
||||
1.20a:
|
||||
- Reworked some math calculations. SIMD instructions are utilized.
|
||||
- A legacy version will also be provided in case your CPU do not support vectorization.
|
||||
- The vectorized version requires the following instruction sets:
|
||||
- SSE
|
||||
- SSE2
|
||||
- SSE3
|
||||
- SSE4.1
|
||||
- Generally, you should be able to run it unless your PC is from 30000BC or you're using a literal potato.
|
||||
- Added a native hitbox visualization mode.
|
||||
- Improved the line-circle intersection algorithm. New algorithm behaves like a circle-polygon intersection.
|
||||
- Overloaded ObjMove_SetDestAtFrame, where movement interpolation mode can be specified.
|
||||
- Fixed a bug where the graze count obtained via GetGraze() may desync with the one obtained via EV_GRAZE's event argument.
|
||||
- Fixed a bug where ObjText_GetTotalWidth/Height may break the font tag.
|
||||
- Fixed a bug where font text tag properties do not get reset after using ObjText_SetText.
|
||||
- Obj_GetValue will now ACTUALLY NOT crash the game if the requested value does not exist.
|
||||
- Renamed the "Obj_[..]ValueR" function series to "Obj_[..]ValueI".
|
||||
- Removed the constant 'pi'. Please use 'M_PI' instead.
|
||||
- Changed error messages of some default functions to be more descriptive to aid debugging.
|
||||
- Greatly improved script variable allocation.
|
||||
- Added a concatenate-assign operator. (~=)
|
||||
- Added bitwise operators. (~, &, |, ^^)
|
||||
- Int values can now be declared with a suffix 'i' or 'I'.
|
||||
- Static type declaration is planned.
|
||||
- Added implicit type casting in default script operations, including comparison and assignment.
|
||||
- Optimized the process of calling default constants.
|
||||
- The default constants SCREEN_WIDTH and SCREEN_HEIGHT will now change to reflect the settings in th_dnh.def.
|
||||
- Some functions will now return int values rather than real values.
|
||||
- Fixed a bug where itoa, atoi, and IntToString would underflow if the input is larger than 2^31-1. (New limit is 2^63-1)
|
||||
- Fixed a bug where the 3D viewport would get stretched out based on the size of the STG frame.
|
||||
- Made the game no longer freeze and crash after Alt-Tab'ing out of true fullscreen mode or after waking the desktop from sleep.
|
||||
- Pseudo-fullscreen mode now stops Windows from drifting off to Dreamland.
|
||||
- Fixed a mistake involving matrix multiplication order in the internal shader for particle list objects.
|
||||
- Removed CollectItemsByType and SetItemIntersectionRadius.
|
||||
- Added new event, EV_COLLECT_ITEM, which triggers when the item starts to move towards the player.
|
||||
- Fixed a bug where ObjShot_SetIntersectionScale[XY] does not scale the position offset.
|
||||
- If ObjFile_Open/ObjFile_OpenNW fails, the reason for failure will now be written to the LogWindow.
|
||||
- The ObjFileB_Read[...] functions no longer throw an error when attempting to read past EOF.
|
||||
- ObjFileB_GetLastRead can be used to obtain the amount of bytes read in the last read operation.
|
||||
- Various optimizations.
|
||||
- Un-Utilized UPX Executable Packer to not-reduce file size.
|
||||
|
||||
1.10c:
|
||||
- Fixed a bug in the UserShotData where rect can override animation_data.
|
||||
- Fixed a bug in the UserShotData where collision did not work at all.
|
||||
- Added functionality to change the color of the delay cloud per-shot.
|
||||
- Fixed a parser bug with nested single-lined statements.
|
||||
- Fixed a rare bug where object IDs may get duplicated when objects are created in rapid succession.
|
||||
- Fixed a bug where the default charset for some fonts are incorrectly determined.
|
||||
- Utilized UPX Executable Packer to reduce file size.
|
||||
|
||||
1.10b:
|
||||
- Fixed bugs with logical and ternary statements.
|
||||
- Improved data packing of common data files. (Files saved with 1.10a are now incompatible.)
|
||||
- Bug fixes and optimizations.
|
||||
|
||||
1.10a:
|
||||
- Fixed some random and function-related crashes.
|
||||
- RenderToTextureXX alpha fix ported+modified from th_dnh_woo.
|
||||
- Replaced ObjLaser_SetGrazeInvalidFrame with ObjShot_SetGrazeInvalidFrame.
|
||||
- Alpha channel blending now exists in all blend modes except BLEND_NONE and BLEND_ADD_RGB.
|
||||
- Fixed a bug where NotifyEvent and SetScriptArgument could not reach package-level scripts when called from a stage-level script.
|
||||
- Event arguments will no longer be overwritten when notifying nested events inside @Event.
|
||||
- Utilized variadic argument counts for the functions in the NotifyEvent series.
|
||||
- Utilized variadic argument counts for the WriteLog function.
|
||||
- Added transform functions for ObjPatternShot and relevant sample scripts, for former and current ECL modders.
|
||||
- Please note that they may not be able to fully emulate ECL's behaviours.
|
||||
- Added functionality to customize delay clouds.
|
||||
- Added an option to use true fullscreen mode in the config.
|
||||
- "Operation-assign" operators (+=, -=, ++, etc.) now work on indexed arrays.
|
||||
- Given: a = [1, 2, 3]
|
||||
- a[0]++ = [2, 2, 3]
|
||||
- a[2] *= 3 = [1, 2, 9]
|
||||
- a += [5, 6] = [6, 8, 3]
|
||||
- Given: b = [[1, 2], [3, 4], [5, 6]]
|
||||
- b[0] += 3 = [[4, 5], [3, 4], [5, 6]]
|
||||
- b[2]-- = [[1, 2], [3, 4], [4, 5]]
|
||||
- Array indexing/slicing operations now automatically truncate indices.
|
||||
- Array slicing operation can now reverse an array.
|
||||
- Given: a = [10, 12, 14, 16, 18, 20]
|
||||
- a[0..3] = [10, 12, 14]
|
||||
- a[3..0] = [14, 12, 10]
|
||||
- a[1..0] = [10]
|
||||
- a[6..2] = [20, 18, 16, 14]
|
||||
- a[2..2] = []
|
||||
- Added ternary statements.
|
||||
- NO_CHANGE can now be used in the ObjMove_AddPatternBX functions.
|
||||
- ObjMove_SetAngle and ObjMove_SetSpeed can now be used on B-pattern objects.
|
||||
- Line-line intersection is now properly implemented.
|
||||
- IsIntersected_Line_Circle can now be used in package-level scripts.
|
||||
- Added a particle renderer object (ObjParticleList) and new relevant sample scripts.
|
||||
- Added support for vertex indexing.
|
||||
- Added support for basic directional lighting.
|
||||
- Improved vertex shader support, and added sample scripts for demonstration.
|
||||
- Fixed underflowing and overflowing issues with SetColor/SetAlpha functions.
|
||||
- Fixed a bug where ObjText_SetFontCharacterSet doesn't work at all.
|
||||
- Added more options to the [font] text tag.
|
||||
- Available tag options:
|
||||
- reset
|
||||
- Resets the text to its original settings. Present in vanilla ph3 as "clear".
|
||||
- size
|
||||
- Adjusts font size. Unchanged from vanilla ph3.
|
||||
- ox/oy
|
||||
- Adjusts position offset.
|
||||
- it
|
||||
- Toggles italic. (true/false or 1/0)
|
||||
- wg
|
||||
- Adjusts font weight.
|
||||
- br/bg/bb
|
||||
- Adjusts font bottom color.
|
||||
- tr/tg/tb
|
||||
- Adjusts font top color.
|
||||
- or/og/ob
|
||||
- Adjusts font border color.
|
||||
- bc
|
||||
- Adjusts font bottom color as an (r, g, b) list.
|
||||
- tc
|
||||
- Adjusts font top color as an (r, g, b) list.
|
||||
- oc
|
||||
- Adjusts font border color as an (r, g, b) list.
|
||||
- Added more options to the [ruby] text tag.
|
||||
- Available tag options:
|
||||
- rb
|
||||
- Sets text. Unchanged from vanilla ph3.
|
||||
- rt
|
||||
- Sets ruby(furigana) text. Unchanged from vanilla ph3.
|
||||
- sz
|
||||
- Adjusts the ruby text's font size.
|
||||
- wg
|
||||
- Adjusts the ruby text's font weight.
|
||||
- ox
|
||||
- Adjusts the ruby text's left margin.
|
||||
- op
|
||||
- Adjusts the ruby text's side pitch.
|
||||
- Improved spacing of ruby text.
|
||||
- ObjFileT now properly reads from and writes to UTF-8 text files.
|
||||
- ObjFile_OpenNW now allows both reading and writing, unless the file was stored in a .dat archive, in which case all write functions will fail.
|
||||
- Pulled the plug on Shift-JIS support in favour of proper Unicode (UTF-8 and UTF-8-BOM) handling.
|
||||
- Better Metasequoia mesh support, and temporarily(?) suspended Elfreina mesh support. Blender .obj mesh support is planned.
|
||||
- The player object will now set its own movement speed and angle according to user key input.
|
||||
- Collecting user-defined items now notify EV_GET_ITEM to the player script.
|
||||
- Minimum custom window size is reduced to 320*240.
|
||||
- GetShotDataInfoA1 no longer throws an error upon receiving an invalid graphic ID, and will instead return default values.
|
||||
- Fixed a bug where the right and bottom source rect set with ObjSprite3D_SetSourceDestRect are 1 greater than expected.
|
||||
- Improved loading of .wav files.
|
||||
- Attempted to fix a bug where multiple sound objects simultaneously playing the same sound file (>1MB .wav, .ogg, or .mp3) would display strange behaviours.
|
||||
- Improved the precision of ObjSound_GetWavePosition, and fixed an issue where ObjSound_GetTotalLength would work incorrectly with .ogg files.
|
||||
- Added bitwise operators.
|
||||
- Greatly improved the LogWindow's Script panel.
|
||||
- Added a text showing the available video memory in the LogWindow's Texture panel.
|
||||
- Added a text showing the used RAM and CPU in the LogWindow's Info panel.
|
||||
- Enforced semicolons before closing braces.
|
||||
- Removed ObjShot_AddShotA1/2.
|
||||
- Various optimizations.
|
||||
|
||||
1.00a:
|
||||
- Multidimensional array assignments are now possible.
|
||||
- Arithmetic operations on array(s) are possible. (Left-right order is important)
|
||||
- [1, 2, 3] + 5 = [6, 7, 8]
|
||||
- [5, 5, 1] * 2 = [10, 10, 2]
|
||||
- [2, 3, 4] - [7, 0, 2] = [-5, 3, 1]
|
||||
- [10, 10, 10] / [5, 2] = [2, 5, 10]
|
||||
- [2, 3] % [4, 2, 1, 6] = [2, 1]
|
||||
- 4 + [2, 3, 6, 2] = 8
|
||||
- Added support for multiple-pass shaders.
|
||||
- Shot and item objects no longer respond to changes in X and Y angles.
|
||||
- Bullet limit of 8192 for performance reasons.
|
||||
- Multiple hitbox support for shot objects has been removed.
|
||||
- Vertex shader support.
|
||||
- Much smaller replay files.
|
||||
- Added an option to specify the skip mode speed in th_dnh.def.
|
||||
- Obj_GetValue will not crash the game if the requested value does not exist.
|
|
@ -0,0 +1,5 @@
|
|||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,11
|
||||
[InternetShortcut]
|
||||
IDList=
|
||||
URL=https://github.com/Natashi/Touhou-Danmakufu-ph3sx-2
|
|
@ -0,0 +1,605 @@
|
|||
Preamble:
|
||||
|
||||
The following keywords are used to clarify the importance of each convention: MUST, SHOULD, MAY, SHOULD NOT, MUST NOT.
|
||||
|
||||
In the code examples below, the sequence "// ..." (two slashes, one space, three full stops) denotes a line where, in most cases, more code should be written.
|
||||
However, such code is unnecessary for the purposes of each example.
|
||||
|
||||
Comments from the writer that do not necessarily dictate style guidelines are preceded by the sequence "// NAZ: ".
|
||||
|
||||
1: Identifiers
|
||||
|
||||
1.1: Variables and Constants
|
||||
|
||||
Note:
|
||||
|
||||
Variables and constants SHOULD be declared with explicit type keywords (float, int, bool, char, string, etc.), unless the type is unknown,
|
||||
in which case either "let" or "var" is used. These keywords are interchangeable, but the scripter MUST decide on one to use consistently.
|
||||
|
||||
Variables MUST be written using camelCase*, while constants MUST use SCREAMING_SNAKE_CASE.
|
||||
Related identifiers SHOULD share the leading parts of their names for alphabetization purposes.
|
||||
|
||||
In cases where variables have short names or are uninitialized, multiple variables MAY be declared on the same line, separated by commas.
|
||||
They SHOULD be of the same type, so fewer keywords are necessary.
|
||||
|
||||
*If necessary, a prefix or suffix MAY be added to a variable in the snake_case style.
|
||||
|
||||
DO:
|
||||
|
||||
float posX, posY;
|
||||
const int BOSS_RUMIA = 0;
|
||||
const int BOSS_CIRNO = 1;
|
||||
|
||||
DON'T:
|
||||
|
||||
let xPos;
|
||||
let yPos;
|
||||
const RUMIA_BOSS = 0, CIRNO_BOSS = 1;
|
||||
|
||||
|
||||
1.1.1: Local Variables
|
||||
|
||||
Variables defined within a local scope, such as inside a function or task, MUST use camelCase without any underscores.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
function<void> DoSomething()
|
||||
{
|
||||
float posX, posY;
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
1.1.2: Global Variables
|
||||
|
||||
Variables defined globally in any script SHOULD be denoted with a leading underscore.
|
||||
This is similar to the notation used for tasks, but with camelCase instead of PascalCase.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
int _objEnemy;
|
||||
int _objPlayer;
|
||||
|
||||
@Initialize
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
1.1.3: Parameters
|
||||
|
||||
Function and task parameters SHOULD be denoted with a trailing underscore.
|
||||
|
||||
Parameters SHOULD be declared with type keywords, or either "let" or "var" if unknown.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
function<void> DoSomethingElse(int foo_, float bar_)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
1.1.4: Iterators
|
||||
|
||||
Iterator variables declared in for-loops, ascent-loops, and descent-loops SHOULD be named lowercase letters of the alphabet starting with "i",
|
||||
progressing to the next letter for each nested loop. This convention MAY be bypassed if more semantic information is necessary.
|
||||
|
||||
Iterator variables declared in for-each-loops SHOULD have single-word names prefixed with "i".
|
||||
|
||||
Fun fact: It is possible to add a second iterator to a for-each-loop, which is listed before the first and iterates through the array's indices (starting from 0) instead of its elements.
|
||||
This variable SHOULD follow the same rules as those declared in for-loops.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
ascent (j in 0 .. 3) {
|
||||
descent (k in 0 .. 4) {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for each (iObj in arrObj) {
|
||||
// ...
|
||||
}
|
||||
|
||||
for each ((i, iObj) in arrObj) {
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
1.1.5: Constants
|
||||
|
||||
As mentioned previously, constants MUST use SCREAMING_SNAKE_CASE. All constants SHOULD be defined in a dedicated constant library.
|
||||
Numeric constants SHOULD be integers instead of float numbers (denoted in decimal literals by appending the character "i" at the end,
|
||||
but this is not necessary if the constant type is explicitly defined).
|
||||
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
const int PLAYER_REIMU = 0;
|
||||
const int PLAYER_MARISA = 1;
|
||||
const int PLAYER_SAKUYA = 2;
|
||||
const int PLAYER_SANAE = 3;
|
||||
|
||||
|
||||
|
||||
1.2: Functions, Tasks, and Subroutines
|
||||
|
||||
Note:
|
||||
|
||||
|
||||
Function, task, and subroutine names all MUST use PascalCase to differentiate them from other identifiers.
|
||||
The root of the identifier name SHOULD begin with a verb.
|
||||
|
||||
// NAZ: The "Is...Exists" structure is Engrish through and through, but I use it for consistency with built-in function names.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
function<void> DoSomething()
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
function<int> GetSomething(int foo_)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
function<void> SetSomething(int foo_, float bar_)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
function<bool> IsSomethingExists(int foo_)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
1.2.1: Functions
|
||||
|
||||
Functions SHOULD be declared with explicit type keywords in angle brackets, unless the type is unknown or variant.
|
||||
|
||||
Function names MUST use PascalCase with no underscores.*
|
||||
Function calls require trailing parentheses, even when there are no arguments.
|
||||
|
||||
*Excluding cases where there is a necessary prefix or suffix denoting important information, such as object type.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
function<void> DoSomething()
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
function<void> DoSomethingElse(bool foo_, float bar_)
|
||||
{
|
||||
DoSomething();
|
||||
// ...
|
||||
}
|
||||
|
||||
function<void> Obj_DoSomething(int obj_)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
function<void> DoSomething_Obj_Obj(int obj1_, int obj2_)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
1.2.2: Tasks
|
||||
|
||||
Task names SHOULD use one of the following styles (and consistently): PascalCase with a leading underscore, OR PascalCase with a leading uppercase T.
|
||||
The same rules about affixes and parentheses that apply to functions apply here.
|
||||
|
||||
// NAZ: I like to treat my tasks as private routines, so often times you'll see me create a "public" function that calls task nested inside.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
task _RenderPlayer(int id_)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
task _RenderPlayer_Reimu()
|
||||
{
|
||||
_RenderPlayer(PLAYER_REIMU);
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
1.2.3: Subroutines
|
||||
|
||||
Subroutines MUST use PascalCase, and SHOULD include a trailing underscore. Parentheses MAY be used.
|
||||
|
||||
It is possible to use the at sign (@) in place of the "sub" keyword, but scripters SHOULD NOT do so, to prevent confusion with built-in routines (@Initialize, @MainLoop, @Finalize, etc.).
|
||||
|
||||
// NAZ: I don't think I've ever used one of these, lol. I came up with the underscore rule on the fly.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
sub DoSomethingDifferent_
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
2: Whitespace
|
||||
|
||||
Note:
|
||||
|
||||
For the sake of consistency, spaces SHOULD be used instead of tabs in ALL cases.
|
||||
The default tab is equivalent to 4 spaces; any decent editor should have an option to insert spaces upon pressing the tab key.
|
||||
|
||||
2.1: Operators
|
||||
|
||||
Expressions and statements consisting of one or more literals and/or identifiers MUST employ one space on both sides of all binary and ternary operators
|
||||
(= +, -, *, /, ~/, %, ^, ~, +=, -=, *=, /=, ~/=, %=, ^=, ~=, ==, !=, >, <, >=, <=, &&, ||, &, |, ^^, .., ?, :).
|
||||
|
||||
Expressions and statements consisting of an identifier and a unary operator (!, ++, --) MUST NOT employ a space between the operator and operand.
|
||||
|
||||
DO:
|
||||
|
||||
float someNum = 6 * 9 + 4 / 20 - 6 % 66;
|
||||
someNum++;
|
||||
|
||||
DON'T:
|
||||
|
||||
float someNum = 6*9+4/20-6%66;
|
||||
someNum ++;
|
||||
|
||||
// NAZ: I will send you to the Shadow Realm if you don't put spaces in between your operators like in the "DON'T" example. It's entirely unreadable for me.
|
||||
|
||||
2.2: Variables and Constants
|
||||
|
||||
Variable and constant declaration and assignment statements MUST employ one space between the keyword (let, var, const) and the identifier,
|
||||
and on both sides of the assignment operator (=) if applicable.*
|
||||
|
||||
As stated previously, if identifiers have short names or are uninitialized, their declarations MAY go on the same line, separated by commas and followed by spaces.
|
||||
|
||||
*Additional spaces MAY be used to vertically align the operator and right-hand side of each statement in a group of statements. See the example.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
const int BGM_TITLE = 0;
|
||||
const int BGM_1_ROAD = 1;
|
||||
const int BGM_1_BOSS = 2;
|
||||
const int BGM_GAMEOVER = 3;
|
||||
|
||||
|
||||
2.3: Functions, Tasks, and Subroutines
|
||||
|
||||
Function, task, and subroutine definitions MUST employ one space between the keyword (function, task, or sub) and the identifier,
|
||||
and NO space between the identifier and the parentheses, differently from flow control statements.
|
||||
Parameters contained inside the parentheses MUST employ one space between each identifier, i.e. after each comma.
|
||||
|
||||
The opening and closing braces of a function, task, or subroutine block MUST go on their own lines, and all lines in between them MUST be indented.
|
||||
There MUST also be an empty line following each closing brace.
|
||||
The same rules also apply to @Initialize, @MainLoop, @Event, @Finalize, and @Loading.
|
||||
|
||||
// Natashi: I don't like placing opening curly braces on newlines. *turns half of your body into pizza dough*
|
||||
|
||||
Function, task, and subroutine invocations MUST NOT include a space between the identifier and parentheses, if applicable.
|
||||
Like parameters, arguments MUST be separated by whitespace, i.e. after each comma.
|
||||
|
||||
Function and task arguments MAY span several indented lines for readability purposes.
|
||||
There SHOULD be an empty space following each multi-line function call, unless it precedes a closing brace or parenthesis.
|
||||
|
||||
// NAZ: This is only really applicable if the arguments get unbearably long, though. The example just demonstrates it just because.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
@Initialize
|
||||
{
|
||||
DoSomething(
|
||||
true,
|
||||
1,
|
||||
1.1,
|
||||
'e',
|
||||
"abc"
|
||||
);
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
function<void> DoSomething(bool foo_, int bar_, float baz_, char qux_, string quux_)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
2.4: Flow Control Statements
|
||||
|
||||
Flow control statements MUST employ whitespace on both sides of each keyword
|
||||
(if, else, loop, while, ascent, descent, in, for, each, alternative, case, others, switch, default, local, yield, break, continue),
|
||||
unless said keyword by itself is a statement (yield, break, continue), in which case it is simply terminated with a semicolon.
|
||||
|
||||
For conditionals and loops, the opening curly brace SHOULD go on the same line as the preceding keyword or closing parenthesis, following a space.*
|
||||
The closing curly brace SHOULD go on its own line, except in the case of "else" and "else if" which SHOULD be written after a space following the closing brace.
|
||||
Loops and conditional structures SHOULD be followed by an empty line.
|
||||
|
||||
For for-loops, each statement ending in a semicolon MUST be followed by a space, i.e. the first and second.
|
||||
The second and third statements may be omitted, in which case a space SHOULD be used instead.
|
||||
When statements are combined with commas, there MUST be a space after each of them.
|
||||
|
||||
*Conditionals and loops containing a single statement terminated with a semicolon MAY be written without curly braces,
|
||||
in which case they SHOULD be written on the same line as the rest of the statement, following a space.
|
||||
Nested conditionals and loops may also be written without curly braces, provided that there is only one semicolon-terminated statement within it.
|
||||
Alternative cases written this way MAY use additional spaces to align their contents.
|
||||
|
||||
EXAMPLE 1 (VERBOSE):
|
||||
|
||||
for (int i = 1, j = 2; i <= 10; i++, j--) {
|
||||
alternative (i)
|
||||
case (1) {
|
||||
WriteLog("i is 1!", "j is 2!");
|
||||
}
|
||||
case (2) {
|
||||
WriteLog("i is 2!", "j is 1!");
|
||||
}
|
||||
others {
|
||||
WriteLog("I can't count that high!");
|
||||
}
|
||||
|
||||
if (i >= 3) {
|
||||
break;
|
||||
} else {
|
||||
loop (5) {
|
||||
yield;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EXAMPLE 2 (CONCISE):
|
||||
|
||||
for (int i = 1, j = 2; i <= 10; i++, j--) {
|
||||
alternative (i)
|
||||
case (1) WriteLog("i is 1!", "j is 2!");
|
||||
case (2) WriteLog("i is 2!", "j is 1!");
|
||||
others WriteLog("I can't count that high!");
|
||||
|
||||
if (i >= 3) break;
|
||||
else loop (5) yield;
|
||||
}
|
||||
|
||||
// NAZ: With "wait" being built-in there's no use case for "loop (n) yield;".
|
||||
// NAZ: I simply wanted to demonstrate nested structures and how they can be shortened.
|
||||
|
||||
2.5: Arrays
|
||||
|
||||
Arrays elements MUST be separated by whitespace, i.e. after each comma.
|
||||
|
||||
Multidimensional or otherwise verbose arrays MAY be written across several indented lines.
|
||||
The initial opening square brace MUST go on the same line as the operator that precedes it.
|
||||
The new lines and indenting SHOULD be consistent throughout each dimension of the array.
|
||||
There SHOULD be an empty space following each multi-line array, unless it precedes a closing brace or parenthesis.
|
||||
|
||||
For performance reasons, arrays SHOULD be indexed as infrequently as possible.
|
||||
If only one element is needed, storing it in a variable is recommended.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
int[] arrSmall = [1, 2, 3];
|
||||
int[][] arrBig = [
|
||||
[1, 2, 3],
|
||||
[4, 5, 6, 7],
|
||||
[8, 9, 10, 11, 12]
|
||||
];
|
||||
|
||||
int[][][] arrBigger = [
|
||||
[
|
||||
[1, 2, 3],
|
||||
[4, 5, 6, 7],
|
||||
], [
|
||||
[8, 9, 10, 11, 12],
|
||||
[13, 14, 15, 16, 17, 18],
|
||||
[19, 20, 21, 22, 23, 24, 25],
|
||||
]
|
||||
];
|
||||
|
||||
int numSmall = arrSmall[2];
|
||||
int numBig = arrBig[2][4];
|
||||
int numBigger = arrBigger[1][2][6];
|
||||
|
||||
|
||||
|
||||
3: Organization
|
||||
|
||||
3.1: Script Structure
|
||||
|
||||
All scripts SHOULD have their sections organized in the following order:
|
||||
|
||||
1. Headers (#TouhouDanmakufu, #ScriptVersion*, #Title, #Text, #System, #Background, #BGM)
|
||||
2. #include directives
|
||||
3. Global variables
|
||||
4. Predefined routines (@Initialize, @Event, @MainLoop, @Finalize, @Loading)
|
||||
5. Script-specific routines
|
||||
|
||||
*The #ScriptVersion header can only take one possible argument (3), and SHOULD be omitted altogether.
|
||||
|
||||
EXAMPLE:
|
||||
|
||||
#TouhouDanmakufu[Stage]
|
||||
#Title["Example Stage"]
|
||||
#Text["An example of a stage script."]
|
||||
#System["script/script_system.dnh"]
|
||||
|
||||
#include "script/include_stg.dnh"
|
||||
|
||||
int _idScript;
|
||||
|
||||
@Initialize
|
||||
{
|
||||
_idScript = GetOwnScriptID();
|
||||
_Main();
|
||||
}
|
||||
|
||||
@MainLoop
|
||||
{
|
||||
yield;
|
||||
}
|
||||
|
||||
@Finalize
|
||||
{
|
||||
WriteLog("Game over!");
|
||||
}
|
||||
|
||||
task _Main()
|
||||
{
|
||||
while (GetPlayerState() != STATE_END) yield;
|
||||
CloseScript(_idScript);
|
||||
}
|
||||
|
||||
|
||||
3.2: Included Files
|
||||
|
||||
As a preface, what the #include directive does is tell the engine to copy the contents of a given text file and paste them into the script, replacing the #include directive.
|
||||
If a file has already been included in the script, it will be skipped.
|
||||
|
||||
To reduce the amount of boilerplate in each script file, the scripter SHOULD create files with the express purpose of including several other files, ideally in a hierarchical manner.
|
||||
|
||||
DO:
|
||||
// In include_main.dnh
|
||||
|
||||
#include "./lib_main.dnh"
|
||||
#include "./lib_const.dnh"
|
||||
#include "./lib_math.dnh"
|
||||
#include "./lib_render.dnh"
|
||||
#include "./lib_event.dnh"
|
||||
|
||||
// In include_stg.dnh
|
||||
|
||||
#include "./include_main.dnh"
|
||||
#include "./lib_stg.dnh"
|
||||
#include "./lib_move.dnh"
|
||||
#include "./lib_shot.dnh"
|
||||
#include "./lib_enemy.dnh"
|
||||
|
||||
// In include_boss.dnh
|
||||
|
||||
#include "./include_stg.dnh"
|
||||
#include "./lib_boss.dnh"
|
||||
#include "./lib_anim.dnh"
|
||||
#include "./lib_spell.dnh"
|
||||
|
||||
// In the main script
|
||||
|
||||
#TouhouDanmakufu[Single]
|
||||
// ...
|
||||
|
||||
#include "script/include_boss.dnh"
|
||||
|
||||
@Initialize
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
DON'T:
|
||||
|
||||
// In the main script
|
||||
|
||||
#TouhouDanmakufu[Single]
|
||||
// ...
|
||||
|
||||
#include "./lib_main.dnh"
|
||||
#include "./lib_const.dnh"
|
||||
#include "./lib_math.dnh"
|
||||
#include "./lib_render.dnh"
|
||||
#include "./lib_event.dnh"
|
||||
#include "./lib_stg.dnh"
|
||||
#include "./lib_move.dnh"
|
||||
#include "./lib_shot.dnh"
|
||||
#include "./lib_enemy.dnh"
|
||||
#include "./lib_boss.dnh"
|
||||
#include "./lib_anim.dnh"
|
||||
#include "./lib_spell.dnh"
|
||||
|
||||
@Initialize
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
// NAZ: These file paths assume that the script as well as all of the library files are located in the base script directory.
|
||||
// NAZ: Ideally, you should have a dedicated lib folder, possibly with subfolders corresponding to the libraries contained in each "include" file.
|
||||
|
||||
3.3: Script Routines
|
||||
|
||||
Scripts (particularly those in which danmaku is created) SHOULD call a task named _Main (or TMain, depending on your chosen style) from @Initialize.
|
||||
This task SHOULD be the ultimate source of all other script-specific routine invocations.
|
||||
|
||||
The scripter SHOULD make use of nesting for a few reasons:
|
||||
|
||||
1. To ensure that variables are limited to their intended scopes.
|
||||
2. To prevent the need to pass variables around unnecessarily via arguments.
|
||||
|
||||
EXAMPLE 1 (NON-NESTED):
|
||||
|
||||
task _Main()
|
||||
{
|
||||
float dir;
|
||||
|
||||
loop {
|
||||
dir = rand(0, 360);
|
||||
_Fire(dir);
|
||||
wait(60);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
task _Fire(float dir_)
|
||||
{
|
||||
float speed = 1;
|
||||
|
||||
loop (5) {
|
||||
Shoot(speed, dir_);
|
||||
speed++;
|
||||
wait(2);
|
||||
}
|
||||
}
|
||||
|
||||
function<void> Shoot(float speed_, float dir_)
|
||||
{
|
||||
int obj = CreateShotA1(someX, someY, speed_, dir_, someID, 15);
|
||||
ObjShot_SetDeleteFrame(obj, 180);
|
||||
}
|
||||
|
||||
EXAMPLE 2 (NESTED):
|
||||
|
||||
task _Main()
|
||||
{
|
||||
float dir;
|
||||
|
||||
loop {
|
||||
dir = rand(0, 360);
|
||||
_Fire();
|
||||
wait(60);
|
||||
}
|
||||
|
||||
task _Fire()
|
||||
{
|
||||
float speed = 1;
|
||||
|
||||
loop (5) {
|
||||
Shoot_;
|
||||
speed++;
|
||||
wait(2);
|
||||
}
|
||||
|
||||
sub Shoot_
|
||||
{
|
||||
int obj = CreateShotA1(someX, someY, speed, dir, someID, 15);
|
||||
ObjShot_SetDeleteFrame(obj, 180);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NAZ: These examples are intentionally bare-bones and only exist for the purposes of demonstrating how nesting can simplify task and function signatures and establish a sense of hierarchy.
|
||||
|
|
@ -0,0 +1,716 @@
|
|||
- Re: Syntax Tutorial
|
||||
|
||||
- Number literals
|
||||
|
||||
- Base literals
|
||||
|
||||
WriteLog(0b1011); //Binary literal, outputs 11
|
||||
WriteLog(0o503); //Octal literal, outputs 323
|
||||
WriteLog(0x8f62); //Hexadecimal literal, outputs 36706
|
||||
|
||||
Base literals default to integer type unless suffixed otherwise.
|
||||
|
||||
- Suffix
|
||||
|
||||
- "f" / "F"
|
||||
Forces a number literal to a float type.
|
||||
- "i" / "I"
|
||||
Forces a number literal to an integer type.
|
||||
|
||||
Example:
|
||||
WriteLog(5); //5.000000
|
||||
WriteLog(5f); //5.000000
|
||||
WriteLog(5i); //5
|
||||
WriteLog(0x5f); //95
|
||||
WriteLog(0x5fi); //95
|
||||
WriteLog(7.76); //7.760000
|
||||
WriteLog(7.76f); //7.760000
|
||||
WriteLog(7.76i); //7
|
||||
|
||||
- Digit separator
|
||||
|
||||
The "_" character can be used in number literals to aid in visibility.
|
||||
Has no effect on the resultant value.
|
||||
|
||||
WriteLog(5000000000i); //5000000000
|
||||
WriteLog(5_000_000_000i); //still 5000000000
|
||||
WriteLog(0x7f23a7e2); //2133043170
|
||||
WriteLog(0x7f23_a7e2); //still 2133043170
|
||||
|
||||
- Variables
|
||||
|
||||
- Explicit types
|
||||
|
||||
Originally, you'd declare a variable with one of these three keywords:
|
||||
- let
|
||||
- var
|
||||
- real
|
||||
All three keywords had the same effect on the declaration.
|
||||
|
||||
However, with version 1.30a, the scripting language has gone through a considerable amount of changes as follows:
|
||||
- "real" has been renamed to "float". (1.32a)
|
||||
|
||||
- You may now explicitly state the type of the variable you are declaring.
|
||||
|
||||
Example:
|
||||
int a = 700; //typeof(a) == VAR_INT
|
||||
float b = 56.243; //typeof(b) == VAR_FLOAT
|
||||
char c = '0'; //typeof(c) == VAR_CHAR
|
||||
bool d = false; //typeof(d) == VAR_BOOL
|
||||
string e = "aubergine"; //typeof(e) == VAR_STRING
|
||||
int[] f = [4i, 8]; //typeof(f) == VAR_ARRAY, ftypeof(f) == VAR_INT
|
||||
|
||||
- This does not change "let" and "var", they will still behave similarly to "auto" in C++.
|
||||
|
||||
Example:
|
||||
let a = 700i; //typeof(a) == VAR_INT
|
||||
let b = 56.243; //typeof(b) == VAR_FLOAT
|
||||
let c = '0'; //typeof(c) == VAR_CHAR
|
||||
let d = false; //typeof(d) == VAR_BOOL
|
||||
let e = "aubergine"; //typeof(e) == VAR_STRING
|
||||
let f = [4i, 8]; //typeof(f) == VAR_ARRAY, ftypeof(f) == VAR_INT
|
||||
|
||||
- You may not use "let[]" or "const[]".
|
||||
|
||||
An array type declaration may only be used with a non-auto type.
|
||||
|
||||
- Multiple variables declaration.
|
||||
|
||||
Example:
|
||||
int a, b = 7, c = 100, d; //All will be of type "int"
|
||||
const bool e = true, f = true; //All will be of type "const bool"
|
||||
let g = 56, h = true, i = 6i; //g will be "float", h will be "bool", and i will be "int"
|
||||
bool[][][] j, k; //All will be of type "bool[][][]" (3D bool array)
|
||||
|
||||
- Using "const"
|
||||
|
||||
"const" is used to declare constant variables.
|
||||
|
||||
A standalone "const" will behave like a "let".
|
||||
"const" can be prefixed or suffixed by another type.
|
||||
|
||||
Constant variables cannot be modified.
|
||||
Attempting to do so will throw a compile-time error.
|
||||
|
||||
Example:
|
||||
const a = 1;
|
||||
const let b = true;
|
||||
const string c = "xolotl";
|
||||
const int d;
|
||||
|
||||
a = 6; //ERROR
|
||||
d = 10; //ERROR
|
||||
|
||||
- Supplement for smart people
|
||||
|
||||
ph3sx script type | internal C type | size in bytes |
|
||||
----------------------------------------------------------
|
||||
int | int64_t | 8 |
|
||||
float | double | 8 |
|
||||
bool | bool | 1 |
|
||||
char | wchar_t | 2 |
|
||||
|
||||
- Scoping
|
||||
|
||||
- "local" has been deprecated. While they have not yet been completely removed, it is advisable to stop using it.
|
||||
|
||||
- But what can I use in its place?
|
||||
|
||||
Nothing.
|
||||
Literally.
|
||||
|
||||
What used to be:
|
||||
|
||||
local {
|
||||
//...
|
||||
}
|
||||
|
||||
can now be reduced to just:
|
||||
|
||||
{
|
||||
//...
|
||||
}
|
||||
|
||||
Scoping rules will still apply normally, like so:
|
||||
|
||||
let a;
|
||||
|
||||
//Only a is accessible here
|
||||
|
||||
{
|
||||
let b;
|
||||
|
||||
//a and b are both accessible here
|
||||
|
||||
{
|
||||
let c;
|
||||
|
||||
//a, b, and c are all accessible here
|
||||
}
|
||||
}
|
||||
|
||||
- Operators
|
||||
|
||||
All available script operators are listed as follows.
|
||||
They are arranged in order of precedence, highest-to-lowest.
|
||||
|
||||
1. ()
|
||||
Function call
|
||||
let c = SomeFunc(a, b);
|
||||
1. as_x()
|
||||
Type cast
|
||||
let a = as_int(x);
|
||||
let b = as_bool(56);
|
||||
1. length()
|
||||
Array length
|
||||
let a = length(x);
|
||||
let b = length([1, 2, 3]);
|
||||
1. []
|
||||
Array indexing
|
||||
let a = arr[3];
|
||||
let b = [10, 100, 1000][x];
|
||||
1. (| |)
|
||||
Absolute
|
||||
let a = (|-4|); //a == 4
|
||||
let b = (|a|); //b == 4
|
||||
1. ()
|
||||
Parentheses
|
||||
2. ^
|
||||
Power (Right-associative)
|
||||
let a = 2 ^ 4; //a == 16
|
||||
let b = 2 ^ 2 ^ 3; //b == 256
|
||||
2. [..]
|
||||
Array slice
|
||||
let x = [9, 10, 11, 12, 13];
|
||||
let a = x[0..2]; //a == [9, 10]
|
||||
let b = x[2..999]; //b == [11, 12, 13]
|
||||
let c = x[3..0]; //c == [11, 10, 9]
|
||||
3. +
|
||||
Unary plus
|
||||
let a = +6;
|
||||
3. -
|
||||
Unary minus
|
||||
let a = -10;
|
||||
3. !
|
||||
Unary logical not
|
||||
let a = !b;
|
||||
3. ~
|
||||
Unary bitwise not
|
||||
let a = ~312; //a == -313
|
||||
let b = ~(0b1011001); //b == -90
|
||||
4. *
|
||||
Multiply
|
||||
let a = 4 * 10; //a == 40
|
||||
4. /
|
||||
Divide
|
||||
let a = 10 / 3; //a == 3.333333
|
||||
4. ~/
|
||||
Floored divide
|
||||
let a = 10 ~/ 3; //a == 3
|
||||
4. %
|
||||
Remainder (Modulo)
|
||||
let a = 7 % 4; //a == 3
|
||||
5. +
|
||||
Add
|
||||
let a = 3 + 32; //a == 35
|
||||
5. -
|
||||
Subtract
|
||||
let a = 9 - 12; //a == -3
|
||||
5. ~
|
||||
Array concatenate
|
||||
let a = [8, 3] ~ [10]; //a == [8, 3, 10]
|
||||
6. <<
|
||||
Bitwise shift left
|
||||
let a = 7 << 3; //a == 56
|
||||
6. >>
|
||||
Bitwise shift right
|
||||
let a = 198 >> 2; //a == 49
|
||||
7. ==
|
||||
!=
|
||||
<
|
||||
<=
|
||||
>
|
||||
>=
|
||||
Comparison
|
||||
let a = 5 < 6;
|
||||
let b = a != false;
|
||||
let c = 10 >= 10;
|
||||
8. ^^
|
||||
Bitwise XOR
|
||||
let a = 63 ^^ 234; //a == 213
|
||||
9. |
|
||||
Bitwise OR
|
||||
let a = 63 | 234; //a == 255
|
||||
10. &
|
||||
Bitwise AND
|
||||
let a = 63 & 234; //a == 42
|
||||
11. ||
|
||||
Logical OR
|
||||
let a = true || false; //a == true
|
||||
11. &&
|
||||
Logical AND
|
||||
let a = true || false; //a == false
|
||||
12. ?:
|
||||
Ternary expression
|
||||
let a = x > y ? 10 : 20;
|
||||
let b = z == 0 ? x * 10 : y + 4;
|
||||
let c = k ? (y ? 8 : 0) : p ? 5 : 2 + x;
|
||||
|
||||
- Boolean expressions
|
||||
|
||||
- Short-circuiting
|
||||
|
||||
This feature was present in vanilla ph3 as well, but I have yet to see a tutorial mention it, so here it is.
|
||||
|
||||
Short-circuiting (short-circuit evaluation) is an optimization for boolean expressions.
|
||||
|
||||
Take these statements, for example:
|
||||
bool c = a && b;
|
||||
bool z = x || y;
|
||||
|
||||
This !RUN-TIME! optimization will occur when expression (a) evaluates to false,
|
||||
where the evaluation of expression (b) will be completely skipped over.
|
||||
Conversely, in the second statement, the evaluation of expression (y) will also be skipped over if
|
||||
expression (x) evaluates to true.
|
||||
|
||||
Short-circuiting will take place left-to-right, so it is beneficial to format your logical expressions
|
||||
in a way that more lightweight expressions get evaluated sooner rather than later.
|
||||
|
||||
Example:
|
||||
if (bCheckHit && GetShotIdInCircleA2(...)) { /*...*/ }
|
||||
|
||||
would benefit more from short-circuit evaluation than
|
||||
|
||||
if (GetShotIdInCircleA2(...) && bCheckHit) { /*...*/ }
|
||||
|
||||
Short-circuiting only applies to logical expressions, not bitwise expressions.
|
||||
|
||||
Example:
|
||||
bool c = a & b;
|
||||
bool d = a | b;
|
||||
|
||||
Here, both expressions (a) and (b) will be evaluated regardless of the result of expression (a).
|
||||
|
||||
- Loops
|
||||
|
||||
- Ascent/Descent
|
||||
|
||||
Ascent and descent loops remain unchanged, but you may now assign an explicit type to the counter variable.
|
||||
|
||||
Example:
|
||||
|
||||
ascent (i in 0..3)
|
||||
WriteLog(i);
|
||||
|
||||
Will result in the following output:
|
||||
0.000000
|
||||
1.000000
|
||||
2.000000
|
||||
|
||||
//-----------------------------------------------
|
||||
|
||||
ascent (i in 0i..3)
|
||||
WriteLog(i);
|
||||
|
||||
Will result in the following output:
|
||||
0
|
||||
1
|
||||
2
|
||||
|
||||
//-----------------------------------------------
|
||||
|
||||
ascent (int i in 0..3)
|
||||
WriteLog(i);
|
||||
|
||||
Will result in the following output:
|
||||
0
|
||||
1
|
||||
2
|
||||
|
||||
- In ph3sx, two new loops are available for use.
|
||||
|
||||
- For loop
|
||||
|
||||
The for loop is the more generalized version of ascent/descent loops.
|
||||
|
||||
It's also the standard loop format in most programming languages,
|
||||
which means I don't have to explain its usage here.
|
||||
|
||||
- For-each loop
|
||||
|
||||
The for-each loop is a quick and efficient method to iterate through arrays.
|
||||
|
||||
Example:
|
||||
|
||||
int[] arr = [10, 9, 8, 7];
|
||||
for each (int i in arr)
|
||||
WriteLog(i);
|
||||
|
||||
Will result in the following output:
|
||||
10
|
||||
9
|
||||
8
|
||||
7
|
||||
|
||||
//-----------------------------------------------
|
||||
|
||||
for each (float i in arr)
|
||||
WriteLog(i);
|
||||
|
||||
Will result in the following output:
|
||||
10.000000
|
||||
9.000000
|
||||
8.000000
|
||||
7.000000
|
||||
|
||||
- The "ref" keyword
|
||||
|
||||
Normally, the array fed into a for-each loop will be a copy of the original array.
|
||||
However, you can force the loop to directly read from the original array with the "ref" keyword.
|
||||
|
||||
As the array won't be copied, there would also be some performance benefits to be had,
|
||||
and the loop will respond to any modifications to the array rather than being unaffected.
|
||||
|
||||
Example:
|
||||
|
||||
int[] arr = [1, 2, 3, 4];
|
||||
|
||||
for each (i in arr) {
|
||||
if (i % 2 == 0)
|
||||
arr ~= [5];
|
||||
WriteLog(i);
|
||||
}
|
||||
WriteLog(arr);
|
||||
|
||||
Will result in the following output:
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
[1, 2, 3, 4, 5, 5]
|
||||
|
||||
//-----------------------------------------------
|
||||
|
||||
for each (i in ref arr) {
|
||||
if (i % 2 == 0)
|
||||
arr ~= [5];
|
||||
WriteLog(i);
|
||||
}
|
||||
WriteLog(arr);
|
||||
|
||||
Will result in the following output:
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
5
|
||||
[1, 2, 3, 4, 5, 5]
|
||||
|
||||
- Special syntaxes
|
||||
|
||||
- There is also another declaration syntax for the for-each loop:
|
||||
|
||||
{
|
||||
int i = 0;
|
||||
for each (itr in array) {
|
||||
//...
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
//is equivalent to:
|
||||
|
||||
for each (i, itr in array) {
|
||||
//...
|
||||
}
|
||||
|
||||
- These formats are also allowed:
|
||||
|
||||
for each ((i, itr) in array) { /*...*/ }
|
||||
for each ((int i, itr) in array) { /*...*/ }
|
||||
for each (i, float itr in array) { /*...*/ }
|
||||
for each ((float i, string itr) in array) { /*...*/ }
|
||||
|
||||
- You may use a colon(:) in place of the keyword "in"
|
||||
|
||||
for each (itr : array) { /*...*/ }
|
||||
for each ((i, itr) : array) { /*...*/ }
|
||||
|
||||
- In addition, there is a new flow control statement "continue".
|
||||
|
||||
"continue" is used in the same manner as "break", but rather than simply ending the loop,
|
||||
it will merely skip the current iteration of the loop.
|
||||
|
||||
Example:
|
||||
|
||||
ascent (int i in 0..8) {
|
||||
if (i % 2 == 0) continue;
|
||||
WriteLog(i);
|
||||
}
|
||||
|
||||
Will result in the following output:
|
||||
1
|
||||
3
|
||||
5
|
||||
7
|
||||
|
||||
- Unlike in vanilla ph3, "break" can no longer be used outside a loop.
|
||||
- Attempting to do so will throw a compile-time error.
|
||||
- The same applies to "continue".
|
||||
|
||||
- Functions, Tasks, Subs ("Callables")
|
||||
|
||||
- Parameters
|
||||
|
||||
Parameters, like variables, can have explicit types.
|
||||
|
||||
Example:
|
||||
|
||||
function Func(int a, float b, const string[] c) {}
|
||||
|
||||
- Function return type
|
||||
|
||||
- You may explicitly specify a function's return type.
|
||||
|
||||
function<int> Func1(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
WriteLog(Func1(10, 4.2)); //Output: 14
|
||||
WriteLog(Func1(10, "sdfs")); //ERROR: Invalid implicit casting
|
||||
|
||||
- Marking a function with type "void" will forbid it from returning a value.
|
||||
|
||||
function<void> Func1(a, b) {
|
||||
return; //OK: no return value
|
||||
}
|
||||
|
||||
function<void> Func2(a, b) {
|
||||
return a + b; //ERROR: void function can't return a value
|
||||
}
|
||||
|
||||
- Overloading
|
||||
|
||||
Two callables with the same name, but different argument counts, will be treated as two different, unique callables.
|
||||
|
||||
Example:
|
||||
|
||||
function<int> Func() {
|
||||
return 0;
|
||||
}
|
||||
function<int> Func(a) {
|
||||
return 100;
|
||||
}
|
||||
function<int> Func(a, b, c) {
|
||||
return a + b + c;
|
||||
}
|
||||
|
||||
DoStuff(); //Returns 0
|
||||
DoStuff("asdf"); //Returns 100
|
||||
DoStuff(1, 2, 3); //Returns 6
|
||||
|
||||
- Variadic argument count (varargs)
|
||||
|
||||
- Some default functions now allow for varargs.
|
||||
|
||||
Example:
|
||||
|
||||
NotifyEventAll(EV_USER, 0);
|
||||
NotifyEventAll(EV_USER, 0, 1, 2, 3);
|
||||
NotifyEventAll(EV_USER, 0, 1, 2, 3, 4, 5, 6, 7, 8);
|
||||
|
||||
//All of the above are valid calls to NotifyEventAll.
|
||||
|
||||
- You can pass a maximum of around 357900000 arguments, but please please don't actually do that.
|
||||
|
||||
- Scripters currently cannot define their own callables with varargs.
|
||||
|
||||
- Async
|
||||
|
||||
Async blocks can be placed anywhere in the code, they behave like inlined tasks.
|
||||
|
||||
Example:
|
||||
|
||||
function Func() {
|
||||
WriteLog(0);
|
||||
|
||||
async {
|
||||
WriteLog(1);
|
||||
wait(10);
|
||||
WriteLog(2);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//is equivalent to:
|
||||
|
||||
function Func() {
|
||||
WriteLog(0);
|
||||
|
||||
task AsyncTask() {
|
||||
WriteLog(1);
|
||||
wait(10);
|
||||
WriteLog(2);
|
||||
}
|
||||
AsyncTask();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
- Script
|
||||
|
||||
- Char
|
||||
|
||||
- Backslash escapes (\\) is properly recognized in char/string literals.
|
||||
- Hexadecimal char literals (\x[hex]) can be used in char/string literals.
|
||||
Example:
|
||||
"\x74" -> "t"
|
||||
'\x3042' -> 'あ'
|
||||
"\x042\x5f" -> "B_"
|
||||
|
||||
- One-lined statements
|
||||
|
||||
Example:
|
||||
|
||||
ascent (i in 0..10) WriteLog(i);
|
||||
|
||||
if (true) a += 10;
|
||||
else a -= 4;
|
||||
|
||||
Can be used everywhere except in function/task/sub declarations, async blocks, @-blocks, and local{} blocks.
|
||||
|
||||
- Optimizations
|
||||
|
||||
- The script compiler will try to perform basic optimizations on maths expressions.
|
||||
|
||||
Examples:
|
||||
|
||||
a = 5 + 5 - 1; -> optimize -> a = 9;
|
||||
a = 5 * 8 / 7; -> optimize -> a = 5.714286;
|
||||
a = func(b) + 5 % 10; -> optimize -> a = func(b) + 5;
|
||||
|
||||
- Empty loops and blocks will be optimized away during script compiling.
|
||||
|
||||
Examples:
|
||||
|
||||
while (true) {}
|
||||
|
||||
for (let i = 0; i < 10; i++) {}
|
||||
|
||||
ascent (i in 0..100000000) {}
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
loop (1000) {
|
||||
}
|
||||
|
||||
for each (i in "aaaaaaaaaa") {}
|
||||
|
||||
async {}
|
||||
|
||||
//All of the above examples will be optimized away
|
||||
|
||||
- Loops containing a single yield will be automatically transformed into a wait.
|
||||
|
||||
Examples:
|
||||
|
||||
loop (60) yield; -> optimize -> wait(60);
|
||||
|
||||
loop (a * 2 + 60 - 20) { -> optimize -> wait(a * 2 + 60 - 20);
|
||||
yield;
|
||||
}
|
||||
|
||||
- Text Object Tags
|
||||
|
||||
Text object tags are special formatting patterns that can be used to dynamically alter rendering of text objects.
|
||||
|
||||
Available tags:
|
||||
|
||||
- r
|
||||
|
||||
Inserts a new line. Also resets formatting from other tags.
|
||||
|
||||
- font / f
|
||||
|
||||
Modifies the font.
|
||||
|
||||
Available tag properties:
|
||||
|
||||
- reset / rs / r / clear / clr / c
|
||||
|
||||
Resets the text to its original settings. Present in vanilla ph3 as "clear".
|
||||
|
||||
- size / sz
|
||||
|
||||
Changes the font size. Unchanged from vanilla ph3.
|
||||
|
||||
- ox / oy
|
||||
|
||||
Changes the position offset.
|
||||
|
||||
- it
|
||||
|
||||
Toggles italic. (true/false or 1/0)
|
||||
|
||||
- wg
|
||||
|
||||
Changes the font's weight.
|
||||
|
||||
- br / bg / bb
|
||||
|
||||
Changes the font's bottom color.
|
||||
|
||||
- tr / tg / tb
|
||||
|
||||
Changes the font's top color.
|
||||
|
||||
- or / og / ob
|
||||
|
||||
Changes the font's border color.
|
||||
|
||||
- bc
|
||||
|
||||
Changes the font's bottom color as a (r, g, b) list.
|
||||
|
||||
- tc
|
||||
|
||||
Changes the font's top color as a (r, g, b) list.
|
||||
|
||||
- oc
|
||||
|
||||
Changes the font's border color as a (r, g, b) list.
|
||||
|
||||
Example:
|
||||
|
||||
ObjText_SetText(obj, "Lorem ipsum [font size=48 it=1 bc=(255, 0, 0)]dolor sit[font clr] amet");
|
||||
|
||||
- ruby
|
||||
|
||||
Creates a ruby(furigana) text.
|
||||
|
||||
Available tag properties:
|
||||
|
||||
- rb
|
||||
|
||||
Sets the main(bottom) text. Unchanged from vanilla ph3.
|
||||
- rt
|
||||
|
||||
Sets the furigana(top) text. Unchanged from vanilla ph3.
|
||||
- sz
|
||||
|
||||
Changes the furigana text's font size.
|
||||
|
||||
- wg
|
||||
|
||||
Changes the furigana text's font weight.
|
||||
|
||||
- ox
|
||||
|
||||
Changes the furigana text's left margin.
|
||||
|
||||
- op
|
||||
|
||||
Changes the furigana text's side pitch.
|
|
@ -0,0 +1,52 @@
|
|||
● Before We Get Started
|
||||
This software is a freeware.
|
||||
The creators are not liable for any mental, physical, or emotional damages caused by using the application.
|
||||
|
||||
● Installation
|
||||
1. Use a software that is able to extract .zip files.
|
||||
If you're seeing this you've probably already done this step. Good job.
|
||||
2. Select the path to which to extract the files.
|
||||
3. Yeah.
|
||||
4. Suffer or enjoy, I don't know.
|
||||
|
||||
● Notes
|
||||
■ Running on Wine
|
||||
If the engine shows an error regarding shader compilation on startup, it's likely because of Wine failing to load required dlls.
|
||||
|
||||
Steps:
|
||||
1a) Install winetricks if you haven't yet.
|
||||
2a) Run 'winetricks d3dx9 d3dcompiler_43' at the console.
|
||||
|
||||
1b) If you've performed the above steps, and the engine still does not work, continue below.
|
||||
2b) Run winetricks -> "Select the default wineprefix" -> "Run winecfg"
|
||||
3b) Select either "Default Settings", or "Add application..." and select the ph3sx binary.
|
||||
- For "Windows Version", select at least Windows 7.
|
||||
4b) Go to the "Libraries" tab, and add overrides for the following dlls:
|
||||
- d3dx9_43
|
||||
- d3dcompiler_43
|
||||
5b) Apply the settings, and everything should now work.
|
||||
|
||||
● Uninstallation
|
||||
Simple delete all the related files.
|
||||
This application does not utilize registry keys nor AppData storage.
|
||||
|
||||
● Key Controls (default)
|
||||
Arrow Keys: Move
|
||||
Z: Shoot, Select
|
||||
X: Bomb, Cancel
|
||||
Left Shift: Hold for Focused Movement
|
||||
Left Ctrl: Hold for Fast Mode
|
||||
R: Return to Script Select Screen (Unavailable by default in package scripts)
|
||||
Backspace: Restart Script (Unavailable by default in package scripts)
|
||||
|
||||
** Default key controls are purely engine-default, and may be overridden and changed from script to script.
|
||||
|
||||
Check out the sample scripts for demonstrations of new functions and features.
|
||||
|
||||
|
||||
|
||||
REPORT BUGS AND/OR GIVE FEATURE REQUESTS TO:
|
||||
|
||||
● https://github.com/Natashi/Touhou-Danmakufu-ph3sx-2/issues on GitHub
|
||||
|
||||
● https://discord.gg/f9KFujKGEx on the ph3sx development Discord server
|
After Width: | Height: | Size: 401 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 449 KiB |
|
@ -0,0 +1,33 @@
|
|||
//書き換えないでください。
|
||||
|
||||
@Initialize
|
||||
{
|
||||
TEnemy();
|
||||
}
|
||||
|
||||
@MainLoop
|
||||
{
|
||||
yield;
|
||||
}
|
||||
|
||||
@Finalize
|
||||
{
|
||||
}
|
||||
|
||||
task TEnemy
|
||||
{
|
||||
let path = GetMainStgScriptPath();
|
||||
let idScript = LoadScript(path);
|
||||
StartScript(idScript);
|
||||
|
||||
while(!IsCloseScript(idScript) && GetPlayerState() != STATE_END)
|
||||
{
|
||||
yield;
|
||||
}
|
||||
|
||||
loop(300){yield;}
|
||||
|
||||
CloseStgScene();
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
//書き換えないでください。
|
||||
|
||||
@Initialize
|
||||
{
|
||||
TEnemy();
|
||||
}
|
||||
|
||||
@MainLoop
|
||||
{
|
||||
yield;
|
||||
}
|
||||
|
||||
@Finalize
|
||||
{
|
||||
}
|
||||
|
||||
task TEnemy
|
||||
{
|
||||
let path = GetMainStgScriptPath();
|
||||
let obj = ObjEnemyBossScene_Create();
|
||||
ObjEnemyBossScene_Add(obj, 0, path);
|
||||
ObjEnemyBossScene_LoadInThread(obj);
|
||||
ObjEnemyBossScene_Regist(obj);
|
||||
|
||||
while(!Obj_IsDeleted(obj) && GetPlayerState() != STATE_END)
|
||||
{
|
||||
yield;
|
||||
}
|
||||
|
||||
loop(300){yield;}
|
||||
|
||||
CloseStgScene();
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,245 @@
|
|||
#TouhouDanmakufu[Single]
|
||||
#ScriptVersion[3]
|
||||
#Title["DPS Test"]
|
||||
#Text["thank you Daniel WishMakers"]
|
||||
#System["script/KevinSystem/Kevin_System.txt"]
|
||||
|
||||
//let shotSheet = GetCurrentScriptDirectory() ~ "./../shot/shot.txt";
|
||||
|
||||
int bossObj; // This is enemy 1
|
||||
|
||||
int enm2, enm3; // This is enemy 2 and 3
|
||||
|
||||
let timer = 0;
|
||||
let timer2 = 0;
|
||||
let timer3 = 0;
|
||||
let timer4 = 0;
|
||||
|
||||
//let phase = 0;
|
||||
let angle = 0;
|
||||
let angle2 = 0;
|
||||
let angle3 = 0;
|
||||
let angle4 = 0;
|
||||
|
||||
let x = 0;
|
||||
let y = 0;
|
||||
|
||||
let image_angle = 0;
|
||||
let HP = 10000000; //- (100 * difficulty);
|
||||
|
||||
// This is for the damage showing
|
||||
let gl_curDPS = 0;
|
||||
let gl_curDPS2 = 0;
|
||||
let gl_curDPS3 = 0;
|
||||
|
||||
let gl_TimeSpent = 0;
|
||||
let gl_TutorialStr = "";
|
||||
const let STR_START = "Release SHOT before testing DPS.";
|
||||
const let STR_GO = "Press and hold SHOT to start testing DPS.";
|
||||
const let STR_FINISH = "Release SHOT when you are finished testing DPS.";
|
||||
|
||||
//#include "script/BHA5/script/Lib/BHA5_Lib.txt"
|
||||
|
||||
#include "script/KevinSystem/Universal_Lib.txt" // The library to include all libraries :sans: :nail_care:
|
||||
|
||||
@Event{
|
||||
alternative(GetEventType())
|
||||
case(EV_REQUEST_LIFE){
|
||||
SetScriptResult(HP);
|
||||
}
|
||||
case(EV_REQUEST_TIMER){
|
||||
SetScriptResult(9999);
|
||||
}
|
||||
case(EV_REQUEST_SPELL_SCORE){
|
||||
SetScriptResult(1000000);
|
||||
}
|
||||
}
|
||||
|
||||
@Initialize{
|
||||
//Shot sheet
|
||||
//LoadTexture(shotSheet);
|
||||
//LoadEnemyShotData(shotSheet);
|
||||
|
||||
SetPlayerLife(20);
|
||||
|
||||
//Boss registration
|
||||
bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
|
||||
ObjEnemy_Regist(bossObj);
|
||||
//SetIntersectionVisualization(true);
|
||||
|
||||
let imgExRumia = GetModuleDirectory() ~ "script/ExRumia/ExRumia.png";
|
||||
ObjPrim_SetTexture(bossObj, imgExRumia);
|
||||
ObjSprite2D_SetSourceRect(bossObj, 64, 1, 127, 64);
|
||||
ObjSprite2D_SetDestCenter(bossObj);
|
||||
ObjRender_SetScaleXYZ(bossObj, 1.5, 1.5, 1);
|
||||
ObjRender_SetColor(bossObj, 0xB93C3C);
|
||||
ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, 550, 1);
|
||||
|
||||
enm2 = ObjEnemy_Create(OBJ_ENEMY);
|
||||
ObjEnemy_Regist(enm2);
|
||||
//SetIntersectionVisualization(true);
|
||||
|
||||
//let imgExRumia = GetModuleDirectory() ~ "script/ExRumia/ExRumia.png";
|
||||
ObjPrim_SetTexture(enm2, imgExRumia);
|
||||
ObjSprite2D_SetSourceRect(enm2, 64, 1, 127, 64);
|
||||
ObjSprite2D_SetDestCenter(enm2);
|
||||
ObjRender_SetScaleXYZ(enm2, 1.5, 1.5, 1);
|
||||
ObjRender_SetColor(enm2, 0xDC5959);
|
||||
ObjMove_SetDestAtFrame(enm2, STG_WIDTH/2, 300, 1);
|
||||
|
||||
ObjEnemy_SetMaximumDamage(enm2, 2000);
|
||||
|
||||
enm3 = ObjEnemy_Create(OBJ_ENEMY);
|
||||
ObjEnemy_Regist(enm3);
|
||||
//SetIntersectionVisualization(true);
|
||||
|
||||
//let imgExRumia = GetModuleDirectory() ~ "script/ExRumia/ExRumia.png";
|
||||
ObjPrim_SetTexture(enm3, imgExRumia);
|
||||
ObjSprite2D_SetSourceRect(enm3, 64, 1, 127, 64);
|
||||
ObjSprite2D_SetDestCenter(enm3);
|
||||
ObjRender_SetScaleXYZ(enm3, 1.5, 1.5, 1);
|
||||
ObjRender_SetColor(enm3, 0xFF8383);
|
||||
ObjMove_SetDestAtFrame(enm3, STG_WIDTH/2, 50, 1);
|
||||
|
||||
ObjEnemy_SetMaximumDamage(enm3, 2000);
|
||||
|
||||
ObjEnemy_SetMaximumDamage(bossObj, 2000);
|
||||
|
||||
main;
|
||||
display;
|
||||
TFinalize;
|
||||
}
|
||||
|
||||
@MainLoop{
|
||||
|
||||
ObjEnemy_SetIntersectionCircleToShot(bossObj,ObjMove_GetX(bossObj),ObjMove_GetY(bossObj),128);
|
||||
ObjEnemy_SetIntersectionCircleToShot(enm2,ObjMove_GetX(enm2),ObjMove_GetY(enm2),128);
|
||||
ObjEnemy_SetIntersectionCircleToShot(enm3,ObjMove_GetX(enm3),ObjMove_GetY(enm3),128);
|
||||
|
||||
//ObjEnemy_SetIntersectionCircleToPlayer(bossObj,ObjMove_GetX(bossObj),ObjMove_GetY(bossObj),32);
|
||||
|
||||
timer++;
|
||||
timer2++;
|
||||
x = ObjMove_GetX(bossObj);
|
||||
y = ObjMove_GetY(bossObj);
|
||||
ObjRender_SetAngleZ(bossObj,image_angle);
|
||||
|
||||
//main;
|
||||
yield;
|
||||
}
|
||||
|
||||
task TFinalize {
|
||||
while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){yield;}
|
||||
Obj_Delete(bossObj);
|
||||
DeleteShotAll(TYPE_ALL, TYPE_IMMEDIATE);
|
||||
SetAutoDeleteObject(true);
|
||||
CloseScript(GetOwnScriptID());
|
||||
return;
|
||||
}
|
||||
|
||||
task display {
|
||||
let objText = CreateTextObject(100,300, 24, "Release SHOT to start testing DPS.");
|
||||
let objMain = CreateTextObject(100,400, 24, "Avg DPS (Front): [r]Frames: ");
|
||||
let objMain2 = CreateTextObject(100,500, 24, "Avg DPS (Middle): ");
|
||||
let objMain3 = CreateTextObject(100,600, 24, "Avg DPS (Back): ");
|
||||
|
||||
loop {
|
||||
ObjText_SetText(objText, gl_TutorialStr);
|
||||
ObjText_SetText(objMain, StringFormat("Avg DPS (Front): %f[r]Frames: %d", "fd", gl_curDPS, gl_TimeSpent));
|
||||
ObjText_SetText(objMain2, StringFormat("Avg DPS (Middle): %f", "f", gl_curDPS2));
|
||||
ObjText_SetText(objMain3, StringFormat("Avg DPS (Back): %f", "f", gl_curDPS3));
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
// thanks wish
|
||||
|
||||
task main {
|
||||
let count = 0;
|
||||
let damage = 0;
|
||||
let damage2 = 0;
|
||||
let damage3 = 0;
|
||||
|
||||
loop {
|
||||
//Reinitialize
|
||||
count = 0;
|
||||
damage = 0;
|
||||
damage2 = 0;
|
||||
damage3 = 0;
|
||||
ObjEnemy_SetLife(bossObj, HP);
|
||||
ObjEnemy_SetLife(enm2, HP);
|
||||
ObjEnemy_SetLife(enm3, HP);
|
||||
gl_TutorialStr = STR_START;
|
||||
|
||||
//Wait for shot to not be held.
|
||||
while(count < 60) {
|
||||
if (CheckShotRelease) {
|
||||
count++;
|
||||
}
|
||||
else {
|
||||
count = 0;
|
||||
}
|
||||
yield;
|
||||
}
|
||||
|
||||
//Wait until player starts pressing SHOT.
|
||||
count = 0;
|
||||
gl_TutorialStr = STR_GO;
|
||||
|
||||
while(!CheckShotHeld) {
|
||||
yield;
|
||||
}
|
||||
|
||||
while(CheckShotHeld) {
|
||||
count++;
|
||||
damage += (HP - ObjEnemy_GetInfo(bossObj, INFO_LIFE));
|
||||
damage2 += (HP - ObjEnemy_GetInfo(enm2, INFO_LIFE));
|
||||
damage3 += (HP - ObjEnemy_GetInfo(enm3, INFO_LIFE));
|
||||
ObjEnemy_SetLife(bossObj, HP);
|
||||
ObjEnemy_SetLife(enm2, HP);
|
||||
ObjEnemy_SetLife(enm3, HP);
|
||||
gl_TimeSpent = count;
|
||||
if (count % 60 == 0) {
|
||||
gl_curDPS = damage;
|
||||
gl_curDPS2 = damage2;
|
||||
gl_curDPS3 = damage3;
|
||||
gl_TutorialStr = STR_FINISH;
|
||||
damage = 0;
|
||||
damage2 = 0;
|
||||
damage3 = 0;
|
||||
}
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function CheckShotRelease {
|
||||
return ((GetVirtualKeyState(VK_SHOT) == KEY_PULL) || (GetVirtualKeyState(VK_SHOT) == KEY_FREE));
|
||||
}
|
||||
|
||||
function CheckShotHeld {
|
||||
return ((GetVirtualKeyState(VK_SHOT) == KEY_PUSH) || (GetVirtualKeyState(VK_SHOT) == KEY_HOLD));
|
||||
}
|
||||
|
||||
//mkm fxn
|
||||
function CreateTextObject(let mx, let my, let size, let text)
|
||||
{
|
||||
let obj = ObjText_Create();
|
||||
ObjText_SetText(obj, text);
|
||||
ObjText_SetFontSize(obj, size);
|
||||
ObjText_SetFontBold(obj, true);
|
||||
ObjText_SetFontColorTop(obj, 128, 128, 255);
|
||||
ObjText_SetFontColorBottom(obj, 64, 64, 255);
|
||||
ObjText_SetFontBorderType(obj, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(obj,255, 255, 255);
|
||||
ObjText_SetFontBorderWidth(obj, 2);
|
||||
Obj_SetRenderPriorityI(obj, 10);
|
||||
ObjRender_SetX(obj, mx);
|
||||
ObjRender_SetY(obj, my);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 324 KiB |
|
@ -0,0 +1,116 @@
|
|||
// Sound effects for boss go here.
|
||||
|
||||
let lib = GetModuleDirectory() ~ "./script/KevinSystem/RyannSFX/ryannlib/";
|
||||
let libKev = "script/KevinSound/";
|
||||
|
||||
let SFXVol = GetAreaCommonData("Config", "SEVol", 100) * 0.01;
|
||||
|
||||
// Sound paths
|
||||
|
||||
let defeatsnd = lib ~ "../bossdie.wav";
|
||||
let lw = lib ~ "sp_lastword.wav";
|
||||
|
||||
let bullet1 = libKev ~ "bfxr_Shoot1.wav"; // Regular bullet sound
|
||||
let bullet2 = libKev ~ "bfxr_Shoot2.wav"; // Shiny bullet sound
|
||||
|
||||
let bullet3 = lib ~ "se_explode.wav";
|
||||
let lightning1 = lib ~ "se_don00.wav"; // Lightning sound 1/Explosion sound
|
||||
let lightning2 = lib ~ "se_kira02.wav"; // Lightning sound 2
|
||||
let laze = lib ~ "se_lazer01.wav"; // Laser sound
|
||||
let lazeB = lib ~ "se_lazer00.wav";
|
||||
let slash = lib ~ "se_slash.ogg";
|
||||
|
||||
let pause = libKev ~ "bfxr_Pause.wav";
|
||||
let chargeA = libKev ~ "bfxr_Charge.wav";
|
||||
|
||||
let selection = libKev ~ "se_select00.wav";
|
||||
let thunder = lib ~ "se_boon00.wav"; // Thunder/delay laser sound
|
||||
let bomb = lib ~ "se_nep00.wav";
|
||||
|
||||
let extend = libKev ~ "bfxr_ExtendLegacy.wav"; // Clear game!
|
||||
|
||||
let lenenwarn = lib ~ "../lenenwarning.wav";
|
||||
let chargeB = lib ~ "se_ch01.wav";
|
||||
|
||||
// Sound objects declarations
|
||||
|
||||
let warnsfx = ObjSound_Create();
|
||||
let lwmusic = ObjSound_Create();
|
||||
let fire1 = ObjSound_Create();
|
||||
let fire2 = ObjSound_Create();
|
||||
let fire3 = ObjSound_Create();
|
||||
let light1 = ObjSound_Create();
|
||||
let light2 = ObjSound_Create();
|
||||
let laser = ObjSound_Create();
|
||||
let laserB = ObjSound_Create();
|
||||
let charge = ObjSound_Create();
|
||||
let phase = ObjSound_Create();
|
||||
let grz = ObjSound_Create();
|
||||
let swing = ObjSound_Create();
|
||||
let pausesfx = ObjSound_Create();
|
||||
let choose = ObjSound_Create();
|
||||
let thundersfx = ObjSound_Create();
|
||||
let bombsfx = ObjSound_Create();
|
||||
let extendsfx = ObjSound_Create();
|
||||
let icebreak = ObjSound_Create();
|
||||
let entrance = ObjSound_Create();
|
||||
|
||||
int sfxBoom = ObjSound_Create();
|
||||
int bossBoom = ObjSound_Create();
|
||||
|
||||
// Merge function that loads sounds and significantly decreases volume
|
||||
// so the ears do not die from SFX overload.
|
||||
|
||||
function LoadEx(targetobj, targetpath, targetvol){
|
||||
|
||||
ObjSound_Load(targetobj, targetpath);
|
||||
ObjSound_SetVolumeRate(targetobj, targetvol * SFXVol);
|
||||
ObjSound_SetSoundDivision(targetobj, SOUND_SE);
|
||||
}
|
||||
|
||||
task _SoundTask{
|
||||
|
||||
//LoadEx(lwmusic, lw, 80);
|
||||
LoadEx(fire1, bullet1, 35);
|
||||
LoadEx(fire2, bullet2, 35);
|
||||
|
||||
/*LoadEx(light1, lightning1, 20);
|
||||
LoadEx(light2, lightning2, 20);
|
||||
LoadEx(laser, laze, 20);
|
||||
LoadEx(laserB, lazeB, 20);
|
||||
//LoadEx(grz, graze, 20);
|
||||
LoadEx(swing, slash, 20);
|
||||
LoadEx(pausesfx, pause, 20);
|
||||
LoadEx(choose, selection, 18);
|
||||
LoadEx(thundersfx, thunder, 25);
|
||||
LoadEx(charge, chargeA, 40);
|
||||
LoadEx(phase, chargeB, 25);
|
||||
LoadEx(fire3, bullet3, 35);
|
||||
LoadEx(bombsfx, bomb, 50);
|
||||
LoadEx(extendsfx, extend, 50);
|
||||
LoadEx(warnsfx, lenenwarn, 30);
|
||||
LoadEx(icebreak, lib ~ "se_don00.wav", 60);
|
||||
LoadEx(entrance, lib ~ "se_gun00.wav", 60);*/
|
||||
|
||||
LoadEx(sfxBoom, libKev ~ "bfxr_EnemyBoom.wav", 45);
|
||||
LoadEx(bossBoom, libKev ~ "bossBoom.wav", 50);
|
||||
}
|
||||
|
||||
// Functions to load sounds in scripts
|
||||
|
||||
task Shoot1{ObjSound_Play(fire1); return;}
|
||||
task Shoot2{ObjSound_Play(fire2); return;}
|
||||
task Shoot3{ObjSound_Play(fire3); return;}
|
||||
task Lit1{ObjSound_Play(light1); return;}
|
||||
task Lit2{ObjSound_Play(light2); return;}
|
||||
task GrazeSFX{ObjSound_Play(grz); return;}
|
||||
task SwordSlashSFX{ObjSound_Play(swing); return;}
|
||||
task PauseGameSFX{ObjSound_Play(pausesfx); return;}
|
||||
task SelectOptionSFX{ObjSound_Play(choose); return;}
|
||||
task LaserSFX{ObjSound_Play(laser); return;}
|
||||
task LaserBSFX{ObjSound_Play(laserB); return;}
|
||||
task ThunderSFX{ObjSound_Play(thundersfx); return;}
|
||||
task ChargeSFX{ObjSound_Play(charge); return;}
|
||||
task ChargeBreakSFX{ObjSound_Play(phase); return;}
|
||||
task BombSFX{ObjSound_Play(bombsfx); return;}
|
||||
task ExtendSFX{ObjSound_Play(extendsfx); return;}
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
if(IsCommonDataAreaExists("PIV") == false){
|
||||
CreateCommonDataArea("PIV");
|
||||
SetAreaCommonData("PIV", "currentvalue", 10000);
|
||||
}
|
||||
else{}
|
||||
|
||||
if(IsCommonDataAreaExists("ScriptID") == false){
|
||||
CreateCommonDataArea("ScriptID");
|
||||
SetAreaCommonData("ScriptID", "SystemID", 0);
|
||||
SetAreaCommonData("ScriptID", "ItemID", 0);
|
||||
}
|
||||
else{}
|
||||
|
After Width: | Height: | Size: 954 KiB |
After Width: | Height: | Size: 605 KiB |
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
For Danmakufu users.
|
||||
|
||||
These functions are meant to be used alongside my pastel shotsheet due to the very high native resolution.
|
||||
*/
|
||||
|
||||
// Bullet rescaling task, also has functionality for setting a new hitbox size relative to the new bullet graphic size. I highly recommend leaving hitboxscale to true.
|
||||
|
||||
task _BulletRescale(target, float scale, bool hitboxscale, hitboxlevel){
|
||||
|
||||
ObjRender_SetScaleXYZ(target, scale, scale, 1);
|
||||
|
||||
if (hitboxscale){
|
||||
ObjShot_SetIntersectionScaleXY(target, scale*hitboxlevel, scale*hitboxlevel); // Note the formula. The hitbox will have been scaled accordingly along with the bullet graphic, but you can use hitboxlevel to adjust the scale further.
|
||||
return;
|
||||
}
|
||||
|
||||
else{return;}
|
||||
|
||||
}
|
||||
|
||||
// Delay task, provided by Naudiz (@Naudogs). For best effects, ensure destscale is equal to the resized scale of the bullet graphic, and orgscale be larger than it.
|
||||
|
||||
task _Delay(target, del, orgscale, destscale, orgalpha, destalpha){
|
||||
|
||||
ObjShot_SetDelay(target, del);
|
||||
ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target)); // unless you already have the ID in the function somewhere, in which case you can just use that, or use any other graphic
|
||||
ObjShot_SetDelayMode(target, DELAY_LERP, LERP_ACCELERATE, LERP_DECELERATE); // delay mode, scale lerp, alpha lerp. Check ph3sx's New Functions Documentation.txt for more details.
|
||||
ObjShot_SetDelayScaleParameter(target, destscale, orgscale, del); // lerps from orgscale to destscale scale in del frames (use the value from ObjShot_SetDelay for del)
|
||||
ObjShot_SetDelayAlphaParameter(target, destalpha, orgalpha, del); // lerps from orgalpha to destalpha scale in del frames (use the value from ObjShot_SetDelay for del)
|
||||
return;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
Kevin's Ultra HD/4K Pastel Shotsheet
|
||||
|
||||
0.10a
|
||||
|
||||
--------
|
||||
|
||||
Thank you for downloading and using my pastel shotsheet!
|
||||
|
||||
This shotsheet features various common bullet types in a variety of "pastel" colors - colors lighter than your usual bullet graphics, but they should hopefully still be just as visible nonetheless. It has a *very* big native resolution (the first sheet is 4096x4096, with each bullet graphic being 256x256), and therefore is meant to be used with a similarly large game resolution and/or bullet rescaling functions. (See misc.txt for information regarding the latter in Danmakufu). It comes pre-packed with shot data and shot constant sheets meant for instant use in Danmakufu.
|
||||
|
||||
The shotsheet is still heavily incomplete. In the works is a second sheet (4096x2048) featuring more bullet types (fireballs, lasers, bubbles), some changes to existing bullet graphics to improve aesthetic and visibility, and half-size versions for regular HD reoslutions.
|
||||
|
||||
How to use:
|
||||
|
||||
Extract the directory to an appropriate location in your project and to load them, just include the shot constant text file in your script file (shotconst_4K.txt).
|
||||
--------
|
||||
The shot sheet images can be used in other engines as well. However it is the responsibility of the user to port the shot sheet data themselves.
|
||||
|
||||
The shot sheet images are free to use NON-COMMERCIALLY. Please credit me (Kevinmonitor/Kevin Mink) fully!
|
||||
|
||||
You are free to modify the shot sheets. Please state so if you do so however (for example, in the credits for your project you put a "modified by the author with permission" next to my attribution).
|
||||
|
||||
Please do not redistribute these shotsheets on your own.
|
||||
--------
|
||||
CONTACT:
|
||||
|
||||
Discord: Kevinmonitor#6745
|
||||
Twitter: @kevinminh_alt
|
|
@ -0,0 +1,108 @@
|
|||
|
||||
local
|
||||
{
|
||||
LoadTextureEx(GetCurrentScriptDirectory ~ "./KevinShot_Alt_HD.png", true, true);
|
||||
LoadTextureEx(GetCurrentScriptDirectory ~ "./KevinShot_Alt_HD_Fireball.png", true, true);
|
||||
LoadEnemyShotData(GetCurrentScriptDirectory ~ "shotdata_HD.txt");
|
||||
LoadEnemyShotData(GetCurrentScriptDirectory ~ "shotdata_HD_2.txt");
|
||||
}
|
||||
|
||||
const KEV_BALL_RED = 2000;
|
||||
const KEV_BALL_ORANGE = 2001;
|
||||
const KEV_BALL_YELLOW = 2002;
|
||||
const KEV_BALL_GREEN = 2003;
|
||||
const KEV_BALL_AQUA = 2004;
|
||||
const KEV_BALL_LAVENDER = 2005;
|
||||
const KEV_BALL_PURPLE = 2006;
|
||||
const KEV_BALL_PINK = 2007;
|
||||
const KEV_BALL_WHITE = 2008;
|
||||
|
||||
const KEV_PEOPLE_RED = 2011;
|
||||
const KEV_PEOPLE_ORANGE = 2012;
|
||||
const KEV_PEOPLE_YELLOW = 2013;
|
||||
const KEV_PEOPLE_GREEN = 2014;
|
||||
const KEV_PEOPLE_AQUA = 2015;
|
||||
const KEV_PEOPLE_LAVENDER = 2016;
|
||||
const KEV_PEOPLE_PURPLE = 2017;
|
||||
const KEV_PEOPLE_PINK = 2018;
|
||||
const KEV_PEOPLE_WHITE = 2019;
|
||||
|
||||
const KEV_LEAF_RED = 2022;
|
||||
const KEV_LEAF_ORANGE = 2023;
|
||||
const KEV_LEAF_YELLOW = 2024;
|
||||
const KEV_LEAF_GREEN = 2025;
|
||||
const KEV_LEAF_AQUA = 2026;
|
||||
const KEV_LEAF_LAVENDER = 2027;
|
||||
const KEV_LEAF_PURPLE = 2028;
|
||||
const KEV_LEAF_PINK = 2029;
|
||||
const KEV_LEAF_WHITE = 2030;
|
||||
|
||||
const KEV_AMULET_RED = 2033;
|
||||
const KEV_AMULET_ORANGE = 2034;
|
||||
const KEV_AMULET_YELLOW = 2035;
|
||||
const KEV_AMULET_GREEN = 2036;
|
||||
const KEV_AMULET_AQUA = 2037;
|
||||
const KEV_AMULET_LAVENDER = 2038;
|
||||
const KEV_AMULET_PURPLE = 2039;
|
||||
const KEV_AMULET_PINK = 2040;
|
||||
const KEV_AMULET_WHITE = 2041;
|
||||
|
||||
const KEV_ARROW_RED = 2044;
|
||||
const KEV_ARROW_ORANGE = 2045;
|
||||
const KEV_ARROW_YELLOW = 2046;
|
||||
const KEV_ARROW_GREEN = 2047;
|
||||
const KEV_ARROW_AQUA = 2048;
|
||||
const KEV_ARROW_LAVENDER = 2049;
|
||||
const KEV_ARROW_PURPLE = 2050;
|
||||
const KEV_ARROW_PINK = 2051;
|
||||
const KEV_ARROW_WHITE = 2052;
|
||||
|
||||
const KEV_BUTTERFLY_RED = 2055;
|
||||
const KEV_BUTTERFLY_ORANGE = 2056;
|
||||
const KEV_BUTTERFLY_YELLOW = 2057;
|
||||
const KEV_BUTTERFLY_GREEN = 2058;
|
||||
const KEV_BUTTERFLY_AQUA = 2059;
|
||||
const KEV_BUTTERFLY_LAVENDER = 2060;
|
||||
const KEV_BUTTERFLY_PURPLE = 2061;
|
||||
const KEV_BUTTERFLY_PINK = 2062;
|
||||
const KEV_BUTTERFLY_WHITE = 2063;
|
||||
|
||||
const KEV_AURABALL_RED = 2066;
|
||||
const KEV_AURABALL_ORANGE = 2067;
|
||||
const KEV_AURABALL_YELLOW = 2068;
|
||||
const KEV_AURABALL_GREEN = 2069;
|
||||
const KEV_AURABALL_AQUA = 2070;
|
||||
const KEV_AURABALL_LAVENDER = 2071;
|
||||
const KEV_AURABALL_PURPLE = 2072;
|
||||
const KEV_AURABALL_PINK = 2073;
|
||||
const KEV_AURABALL_WHITE = 2074;
|
||||
|
||||
const KEV_FIRE_RED = 2075;
|
||||
const KEV_FIRE_ORANGE = 2076;
|
||||
const KEV_FIRE_YELLOW = 2077;
|
||||
const KEV_FIRE_GREEN = 2078;
|
||||
const KEV_FIRE_AQUA = 2079;
|
||||
const KEV_FIRE_LAVENDER = 2080;
|
||||
const KEV_FIRE_PURPLE = 2081;
|
||||
const KEV_FIRE_PINK = 2082;
|
||||
const KEV_FIRE_WHITE = 2083;
|
||||
|
||||
const KEV_BUBBLE_RED = 2086;
|
||||
const KEV_BUBBLE_ORANGE = 2087;
|
||||
const KEV_BUBBLE_YELLOW = 2088;
|
||||
const KEV_BUBBLE_GREEN = 2089;
|
||||
const KEV_BUBBLE_AQUA = 2090;
|
||||
const KEV_BUBBLE_LAVENDER = 2091;
|
||||
const KEV_BUBBLE_PURPLE = 2092;
|
||||
const KEV_BUBBLE_PINK = 2093;
|
||||
|
||||
const KEV_KNIFE_RED = 2096;
|
||||
const KEV_KNIFE_ORANGE = 2097;
|
||||
const KEV_KNIFE_YELLOW = 2098;
|
||||
const KEV_KNIFE_GREEN = 2099;
|
||||
const KEV_KNIFE_AQUA = 2100;
|
||||
const KEV_KNIFE_LAVENDER = 2101;
|
||||
const KEV_KNIFE_PURPLE = 2102;
|
||||
const KEV_KNIFE_PINK = 2103;
|
||||
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
#UserShotData
|
||||
|
||||
shot_image = "./KevinShot_Alt_HD.png"
|
||||
|
||||
ShotData { id = 2000 rect = (0,0,128,128) collision = 26 delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2001 rect = (128,0,256,128) collision = 26 delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2002 rect = (256,0,384,128) collision = 26 delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2003 rect = (384,0,512,128) collision = 26 delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2004 rect = (512,0,640,128) collision = 26 delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2005 rect = (640,0,768,128) collision = 26 delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2006 rect = (768,0,896,128) collision = 26 delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2007 rect = (896,0,1024,128) collision = 26 delay_color = (255,255,255) } //PINK
|
||||
ShotData { id = 2008 rect = (1024,0,1152,128) collision = 26 delay_color = (255,255,255) } //WHITE
|
||||
|
||||
ShotData { id = 2011 rect = (0,128,128,256) collision = (17,0,-7) delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2012 rect = (128,128,256,256) collision = (17,0,-7) delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2013 rect = (256,128,384,256) collision = (17,0,-7) delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2014 rect = (384,128,512,256) collision = (17,0,-7) delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2015 rect = (512,128,640,256) collision = (17,0,-7) delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2016 rect = (640,128,768,256) collision = (17,0,-7) delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2017 rect = (768,128,896,256) collision = (17,0,-7) delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2018 rect = (896,128,1024,256) collision = (17,0,-7) delay_color = (255,255,255) } //PINK
|
||||
ShotData { id = 2019 rect = (1024,128,1152,256) collision = (17,0,-7) delay_color = (255,255,255) } //WHITE
|
||||
|
||||
ShotData { id = 2022 rect = (0,256,128,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2023 rect = (128,256,256,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2024 rect = (256,256,384,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2025 rect = (384,256,512,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2026 rect = (512,256,640,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2027 rect = (640,256,768,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2028 rect = (768,256,896,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2029 rect = (896,256,1024,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //PINK
|
||||
ShotData { id = 2030 rect = (1024,256,1152,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //WHITE
|
||||
|
||||
ShotData { id = 2033 rect = (0,384,128,512) collision = (28,0,0) delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2034 rect = (128,384,256,512) collision = (28,0,0) delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2035 rect = (256,384,384,512) collision = (28,0,0) delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2036 rect = (384,384,512,512) collision = (28,0,0) delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2037 rect = (512,384,640,512) collision = (28,0,0) delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2038 rect = (640,384,768,512) collision = (28,0,0) delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2039 rect = (768,384,896,512) collision = (28,0,0) delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2040 rect = (896,384,1024,512) collision = (28,0,0) delay_color = (255,255,255) } //PINK
|
||||
ShotData { id = 2041 rect = (1024,384,1152,512) collision = (28,0,0) delay_color = (255,255,255) } //WHITE
|
||||
|
||||
ShotData { id = 2044 rect = (0,512,128,640) collision = (8,0,20) delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2045 rect = (128,512,256,640) collision = (8,0,20) delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2046 rect = (256,512,384,640) collision = (8,0,20) delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2047 rect = (384,512,512,640) collision = (8,0,20) delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2048 rect = (512,512,640,640) collision = (8,0,20) delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2049 rect = (640,512,768,640) collision = (8,0,20) delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2050 rect = (768,512,896,640) collision = (8,0,20) delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2051 rect = (896,512,1024,640) collision = (8,0,20) delay_color = (255,255,255) } //PINK
|
||||
ShotData { id = 2052 rect = (1024,512,1152,640) collision = (8,0,20) delay_color = (255,255,255) } //WHITE
|
||||
|
||||
ShotData { id = 2055 rect = (0,640,128,768) collision = 12 delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2056 rect = (128,640,256,768) collision = 12 delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2057 rect = (256,640,384,768) collision = 12 delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2058 rect = (384,640,512,768) collision = 12 delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2059 rect = (512,640,640,768) collision = 12 delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2060 rect = (640,640,768,768) collision = 12 delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2061 rect = (768,640,896,768) collision = 12 delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2062 rect = (896,640,1024,768) collision = 12 delay_color = (255,255,255) } //PINK
|
||||
ShotData { id = 2063 rect = (1024,640,1152,768) collision = 12 delay_color = (255,255,255) } //WHITE
|
||||
|
||||
ShotData { id = 2066 rect = (0,768,128,896) collision = 18 delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2067 rect = (128,768,256,896) collision = 18 delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2068 rect = (256,768,384,896) collision = 18 delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2069 rect = (384,768,512,896) collision = 18 delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2070 rect = (512,768,640,896) collision = 18 delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2071 rect = (640,768,768,896) collision = 18 delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2072 rect = (768,768,896,896) collision = 18 delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2073 rect = (896,768,1024,896) collision = 18 delay_color = (255,255,255) } //PINK
|
||||
ShotData { id = 2074 rect = (1024,768,1152,896) collision = 18 delay_color = (255,255,255) } //WHITE
|
||||
|
||||
75 -> 83: fireballs
|
||||
|
||||
ShotData { id = 2086 rect = (0,896,256,1152) collision = 48 delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2087 rect = (256,896,512,1152) collision = 48 delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2088 rect = (512,896,768,1152) collision = 48 delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2089 rect = (768,896,1024,1152) collision = 48 delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2090 rect = (1024,896,1280,1152) collision = 48 delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2091 rect = (1280,896,1536,1152) collision = 48 delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2092 rect = (1536,896,1792,1152) collision = 48 delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2093 rect = (1792,896,2048,1152) collision = 48 delay_color = (255,255,255) } //PINK
|
||||
|
||||
ShotData { id = 2096 rect = (0,1152,128,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2097 rect = (128,1152,256,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2098 rect = (256,1152,384,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2099 rect = (384,1152,512,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2100 rect = (512,1152,640,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2101 rect = (640,1152,768,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2102 rect = (768,1152,896,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2103 rect = (896,1152,1024,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //PINK
|
||||
ShotData { id = 2104 rect = (1024,1152,1152,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //WHITE
|
||||
ShotData { id = 2105 rect = (1152,1152,1280,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //
|
||||
ShotData { id = 2106 rect = (1280,1152,1408,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
#UserShotData
|
||||
|
||||
shot_image = "./KevinShot_Alt_HD_Fireball.png"
|
||||
|
||||
ShotData { id = 2075 AnimationData { animation_data = ( 4, 0, 0, 128, 128); animation_data = ( 4, 128, 0, 256, 128); animation_data = ( 4, 256, 0, 384, 128); animation_data = ( 4, 384, 0, 512, 128); animation_data = ( 4, 512, 0, 640, 128); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //RED
|
||||
ShotData { id = 2076 AnimationData { animation_data = ( 4, 0, 128, 128, 256); animation_data = ( 4, 128, 128, 256, 256); animation_data = ( 4, 256, 128, 384, 256); animation_data = ( 4, 384, 128, 512, 256); animation_data = ( 4, 512, 128, 640, 256); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //ORANGE
|
||||
ShotData { id = 2077 AnimationData { animation_data = ( 4, 0, 256, 128, 384); animation_data = ( 4, 128, 256, 256, 384); animation_data = ( 4, 256, 256, 384, 384); animation_data = ( 4, 384, 256, 512, 384); animation_data = ( 4, 512, 256, 640, 384); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //YELLOW
|
||||
ShotData { id = 2078 AnimationData { animation_data = ( 4, 0, 384, 128, 512); animation_data = ( 4, 128, 384, 256, 512); animation_data = ( 4, 256, 384, 384, 512); animation_data = ( 4, 384, 384, 512, 512); animation_data = ( 4, 512, 384, 640, 512); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //GREEN
|
||||
ShotData { id = 2079 AnimationData { animation_data = ( 4, 0, 512, 128, 640); animation_data = ( 4, 128, 512, 256, 640); animation_data = ( 4, 256, 512, 384, 640); animation_data = ( 4, 384, 512, 512, 640); animation_data = ( 4, 512, 512, 640, 640); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //AQUA
|
||||
ShotData { id = 2080 AnimationData { animation_data = ( 4, 0, 640, 128, 768); animation_data = ( 4, 128, 640, 256, 768); animation_data = ( 4, 256, 640, 384, 768); animation_data = ( 4, 384, 640, 512, 768); animation_data = ( 4, 512, 640, 640, 768); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //LAVENDER
|
||||
ShotData { id = 2081 AnimationData { animation_data = ( 4, 0, 768, 128, 896); animation_data = ( 4, 128, 768, 256, 896); animation_data = ( 4, 256, 768, 384, 896); animation_data = ( 4, 384, 768, 512, 896); animation_data = ( 4, 512, 768, 640, 896); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //PURPLE
|
||||
ShotData { id = 2082 AnimationData { animation_data = ( 4, 0, 896, 128, 1024); animation_data = ( 4, 128, 896, 256, 1024); animation_data = ( 4, 256, 896, 384, 1024); animation_data = ( 4, 384, 896, 512, 1024); animation_data = ( 4, 512, 896, 640, 1024); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //PINK
|
||||
ShotData { id = 2083 AnimationData { animation_data = ( 4, 0, 1024, 128, 1152); animation_data = ( 4, 128, 1024, 256, 1152); animation_data = ( 4, 256, 1024, 384, 1152); animation_data = ( 4, 384, 1024, 512, 1152); animation_data = ( 4, 512, 1024, 640, 1152); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //WHITE
|
|
@ -0,0 +1,346 @@
|
|||
/* --------------------------------------------------------------------
|
||||
|
||||
UNIVERSAL/GENERAL FUNCTIONS USED FOR PLAYERS
|
||||
|
||||
These functions may/will be reused for future scripts as well.
|
||||
|
||||
--------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "script/KevinSystem/kevin_system/Kevin_ItemConst.txt"
|
||||
#include "script/KevinSystem/kevin_system/Kevin_ItemLib.txt"
|
||||
|
||||
float universalAlpha = GetAreaCommonData("Config", "PlayerShotOpacity", 60);
|
||||
//universalAlpha = 255; // Debug
|
||||
|
||||
task _DeleteEffect(obj, scale){
|
||||
ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
|
||||
Obj_SetRenderPriorityI(obj, 49);
|
||||
ascent(i in 0..30){
|
||||
ObjRender_SetAlpha(obj, Interpolate_Decelerate(100*(universalAlpha/100), 0, i/30));
|
||||
ObjRender_SetScaleXYZ(obj, Interpolate_Decelerate(scale, scale*2, i/30));
|
||||
ObjMove_SetSpeed(obj, 12);
|
||||
yield;
|
||||
}
|
||||
Obj_Delete(obj);
|
||||
}
|
||||
|
||||
// Renders player movement. Assumes that all sprites are ORGANIZED HORIZONTALLY IN THE SHEET.
|
||||
// flipscale can only be 1 or -1.
|
||||
|
||||
task _RenderPlayerMovement(int obj, int frame, int offsetleft, int offsettop, int width, int height, float flipscale, int frameno, int speed){
|
||||
|
||||
ObjSprite2D_SetSourceRect(obj, offsetleft+width*floor(frame/speed), offsettop, width+width*floor(frame/speed), offsettop+height);
|
||||
ObjRender_SetScaleX(objPlayer, flipscale);
|
||||
|
||||
}
|
||||
|
||||
// Bullet rescaling... for player shots.
|
||||
task _BulletRescalePlayer(int target, float scale, bool hitboxscale, float hitboxlevel){
|
||||
ObjRender_SetScaleXYZ(target, scale, scale, 1);
|
||||
if (hitboxscale){
|
||||
ObjShot_SetIntersectionScaleXY(target, scale*hitboxlevel, scale*hitboxlevel);
|
||||
}
|
||||
}
|
||||
|
||||
// Handles death/respawn sigil. Assumes sigils are 512x512 in size.
|
||||
// If death is true (the player dies), the circle expands outwards. Otherwise (the player bombs/respawns), it shrinks inwards.
|
||||
|
||||
task _SigilCall(bool death, texture, int rectleft, int recttop, int rectright, int rectbottom, int objPlayer, int time){
|
||||
|
||||
let DeathCircle = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
|
||||
ObjPrim_SetTexture(DeathCircle,teamimg);
|
||||
ObjSprite2D_SetSourceRect(DeathCircle, rectleft, recttop, rectright, rectbottom);
|
||||
ObjSprite2D_SetDestCenter(DeathCircle);
|
||||
ObjRender_SetBlendType(DeathCircle,BLEND_ALPHA);
|
||||
ObjRender_SetAlpha(DeathCircle,255);
|
||||
|
||||
ObjRender_SetPosition(DeathCircle,GetPlayerX(),GetPlayerY(),1);
|
||||
Obj_SetRenderPriorityI(DeathCircle,Obj_GetRenderPriorityI(objPlayer)-10);
|
||||
|
||||
alternative(death)
|
||||
case(true){
|
||||
ascent(i in 0..time){
|
||||
float scaliealpha = Interpolate_Decelerate(255, 0, i/time);
|
||||
float scaliesize = Interpolate_Decelerate(0.1, 3, i/time);
|
||||
ObjRender_SetAlpha(DeathCircle, scaliealpha);
|
||||
ObjRender_SetPosition(DeathCircle,GetPlayerX(),GetPlayerY(),1);
|
||||
ObjRender_SetScaleXYZ(DeathCircle, scaliesize, scaliesize, 1);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
case(false){
|
||||
ascent(i in 0..time){
|
||||
float scaliealpha = Interpolate_Accelerate(255, 0, i/time);
|
||||
float scaliesize = Interpolate_Accelerate(3, 0.1, i/time);
|
||||
ObjRender_SetAlpha(DeathCircle, scaliealpha);
|
||||
ObjRender_SetPosition(DeathCircle,GetPlayerX(),GetPlayerY(),1);
|
||||
ObjRender_SetScaleXYZ(DeathCircle, scaliesize, scaliesize, 1);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
while(ObjRender_GetAlpha(DeathCircle) > 0){yield;}
|
||||
Obj_Delete(DeathCircle);
|
||||
|
||||
}
|
||||
|
||||
// Handles the hitbox and its aura. What the fuck.
|
||||
|
||||
task _HitboxRender(
|
||||
bool playerdeathbool, int objPlayer, texture_hbox, texture_aura,
|
||||
int rectleft_hbox, int recttop_hbox, int rectright_hbox, int rectbottom_hbox,
|
||||
int rectleft_aura, int recttop_aura, int rectright_aura, int rectbottom_aura,
|
||||
float scale_hbox, float scale_aura){
|
||||
|
||||
// Handle hitbox
|
||||
bool visible = false;
|
||||
int hitbox = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
|
||||
ObjPrim_SetTexture(hitbox, texture_hbox);
|
||||
ObjSprite2D_SetSourceRect(hitbox, rectleft_hbox, recttop_hbox, rectright_hbox, rectbottom_hbox);
|
||||
ObjSprite2D_SetDestCenter(hitbox);
|
||||
ObjRender_SetScaleXYZ(hitbox, scale_hbox, scale_hbox, 1);
|
||||
ObjRender_SetBlendType(hitbox, BLEND_ALPHA);
|
||||
Obj_SetRenderPriorityI(hitbox, 79);
|
||||
|
||||
Obj_SetVisible(hitbox, false);
|
||||
|
||||
// Handle hitbox's aura
|
||||
|
||||
int aura = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
|
||||
ObjPrim_SetTexture(aura, texture_aura);
|
||||
ObjSprite2D_SetSourceRect(aura, rectleft_aura, recttop_aura, rectright_aura, rectbottom_aura);
|
||||
ObjSprite2D_SetDestCenter(aura);
|
||||
ObjRender_SetScaleXYZ(aura, scale_aura, scale_aura, 1);
|
||||
ObjRender_SetAlpha(aura, 70);
|
||||
//ObjRender_SetBlendType(aura, BLEND_ADD_ARGB);
|
||||
Obj_SetRenderPriorityI(aura, Obj_GetRenderPriorityI(objPlayer)+3);
|
||||
|
||||
Obj_SetVisible(aura, false);
|
||||
|
||||
loop{
|
||||
if (visible && (!Obj_IsVisible(objPlayer) || GetVirtualKeyState(VK_SLOWMOVE) != KEY_HOLD)){
|
||||
visible = false;
|
||||
Obj_SetVisible(hitbox, false);
|
||||
Obj_SetVisible(aura, false);
|
||||
}
|
||||
else if (!visible && (Obj_IsVisible(objPlayer) && (GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD || GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH))){
|
||||
visible = true;
|
||||
Obj_SetVisible(aura, true);
|
||||
Obj_SetVisible(hitbox, true);
|
||||
async{
|
||||
while(Obj_IsVisible(aura)){
|
||||
float curang = ObjRender_GetAngleZ(aura);
|
||||
ObjRender_SetAngleZ(aura, curang+1);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
async{
|
||||
ascent(i in 0..20){
|
||||
float scalie = Interpolate_Decelerate(scale_aura*1.5, scale_aura, i/20);
|
||||
ObjRender_SetScaleXYZ(aura, scalie, scalie, 1);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
async{
|
||||
ascent(i in 0..20){
|
||||
float scalie = Interpolate_Decelerate(0, 80, i/20);
|
||||
ObjRender_SetAlpha(aura, scalie);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
}
|
||||
ObjRender_SetPosition(hitbox, ObjMove_GetX(objPlayer), ObjMove_GetY(objPlayer), 1);
|
||||
ObjRender_SetPosition(aura, ObjMove_GetX(objPlayer), ObjMove_GetY(objPlayer), 1);
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Simple function that handles player options. These options simply follow the player at an offset - they do not have any trajectories of their own like spinning around the player, etc.
|
||||
If the options have animations, set triggeranimation to true and adjust the number of frames + speed using delay and frameno.
|
||||
If the options rotate (in place), set triggerspin to true and adjust spinning speed using spinspeed.
|
||||
If the options only appear unfocused or focused, set either onlyFocus or onlyUnfocus to true. Setting both to true or false makes the options always visible.
|
||||
*/
|
||||
|
||||
function PlayerOption(
|
||||
float offsetx, float offsety,
|
||||
texture,
|
||||
int left, int top, int right, int bottom, float scale,
|
||||
int width, int animdelay, int frameno, bool triggeranimation,
|
||||
bool triggerspin, float spinspeed,
|
||||
bool onlyFocus, bool onlyUnfocus
|
||||
){
|
||||
|
||||
let option = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
bool visible;
|
||||
int animate = 0;
|
||||
float optx;
|
||||
float opty;
|
||||
|
||||
ObjPrim_SetTexture(option, texture);
|
||||
ObjSprite2D_SetSourceRect(option, left, top, right-1, bottom-1); // Allows the options to spin smoothly should the user choose to do so.
|
||||
ObjSprite2D_SetDestCenter(option);
|
||||
ObjRender_SetScaleXYZ(option, scale);
|
||||
ObjRender_SetBlendType(option, BLEND_ALPHA);
|
||||
ObjRender_SetAlpha(option, 255);
|
||||
Obj_SetRenderPriorityI(option, 41);
|
||||
ObjRender_SetPosition(option, offsetx, offsety, 1);
|
||||
|
||||
// Animation
|
||||
async{
|
||||
while(triggeranimation){
|
||||
ObjSprite2D_SetSourceRect(option, left+width*floor(animate/animdelay), top, right+width*floor(animate/animdelay)-1, bottom-1);
|
||||
animate++;
|
||||
if (animate >= animdelay*frameno){animate = 0;}
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
// Rotation
|
||||
async{
|
||||
float i = 0;
|
||||
while(triggerspin){
|
||||
//ObjRender_SetPosition(option, GetPlayerX()+offsetx, GetPlayerY()+offsety, 1);
|
||||
ObjRender_SetAngleZ(option, i);
|
||||
i += spinspeed;
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
// Follow
|
||||
async{
|
||||
while(true){
|
||||
ObjRender_SetPosition(option, GetPlayerX()+offsetx, GetPlayerY()+offsety, 1);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
// Visibility
|
||||
async{
|
||||
// Always visible
|
||||
if((onlyFocus && onlyUnfocus) || (!onlyFocus && !onlyUnfocus)) {
|
||||
loop
|
||||
{
|
||||
if(GetPlayerState != STATE_NORMAL && GetPlayerState != STATE_HIT){ObjRender_SetAlpha(option, max(0, ObjRender_GetAlpha(option)-15)); visible = false;}
|
||||
else {ObjRender_SetAlpha(option, min(225, ObjRender_GetAlpha(option)+15)); visible = true;}
|
||||
yield;
|
||||
}
|
||||
}
|
||||
// Visible when focused only
|
||||
else if(onlyFocus && !onlyUnfocus){
|
||||
loop
|
||||
{
|
||||
if((GetPlayerState != STATE_NORMAL && GetPlayerState != STATE_HIT) || GetVirtualKeyState(VK_SLOWMOVE) == KEY_FREE){ObjRender_SetAlpha(option, max(0, ObjRender_GetAlpha(option)-15)); visible = false;}
|
||||
else {ObjRender_SetAlpha(option, min(225, ObjRender_GetAlpha(option)+15)); visible = true;}
|
||||
yield;
|
||||
}
|
||||
}
|
||||
// Visible when unfocused only
|
||||
else if(!onlyFocus && onlyUnfocus){
|
||||
loop
|
||||
{
|
||||
if((GetPlayerState != STATE_NORMAL && GetPlayerState != STATE_HIT) || GetVirtualKeyState(VK_SLOWMOVE) != KEY_FREE){ObjRender_SetAlpha(option, max(0, ObjRender_GetAlpha(option)-15)); visible = false;}
|
||||
else {ObjRender_SetAlpha(option, min(225, ObjRender_GetAlpha(option)+15)); visible = true;}
|
||||
yield;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _FadeIn(){
|
||||
ascent(i in 0..15){
|
||||
ObjRender_SetAlpha(option, Interpolate_Decelerate(0, 225, i/15));
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
function _FadeOut(){
|
||||
ascent(i in 0..15){
|
||||
ObjRender_SetAlpha(option, Interpolate_Decelerate(225, 0, i/15));
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
/*
|
||||
------------------------------------------------------
|
||||
|
||||
POINTBLANK-PIV MECHANIC FUNCTIONS
|
||||
Will be optimized somewhere down the line.
|
||||
|
||||
------------------------------------------------------
|
||||
*/
|
||||
|
||||
// Selects an enemy in the @MainLoop-updated _enemyArray, executes _PetalDrop, and adds it to _existArray so the task isn't called again for the same enemy. maxX and maxY are the bounds of the playing field.
|
||||
|
||||
task _Mechanic(bool playerdeathbool, int[] _enemyArray, int [] _existArray, float maxX, float maxY, int objPlayer, int bossScene, int maxrate, int addrate, float adddist){
|
||||
while(!playerdeathbool){
|
||||
_enemyArray = GetIntersectionRegistedEnemyID();
|
||||
bossScene = GetEnemyBossSceneObjectID();
|
||||
for each (int enemy in ref _enemyArray){
|
||||
float enemyX = ObjMove_GetX(enemy);
|
||||
float enemyY = ObjMove_GetY(enemy);
|
||||
if (0 < enemyX && enemyX < maxX && 0 < enemyY && enemyY < maxY && !contains(_existArray, enemy)){
|
||||
_PetalDrop(enemy, playerdeathbool, objPlayer, bossScene, maxrate, addrate, adddist);
|
||||
_existArray = _existArray ~ [enemy];
|
||||
}
|
||||
else{continue;}
|
||||
}
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks the boss scene type (nonspell/spell/last spell/invalid), the ID of the player object, and the target enemy. Drops petals with a type and drop rate that depends on the boss scene type and how close the player is to the target enemy. The last three parameters control the drop rate, and are significantly higher for Erika & Tenshi.
|
||||
|
||||
task _PetalDrop(int target, bool playerdeathbool, int objPlayer, int bossScene, int maxrate, int addrate, float adddist){
|
||||
|
||||
while(!Obj_IsDeleted(target) && !playerdeathbool){
|
||||
float dist = hypot(ObjMove_GetX(target)-ObjMove_GetX(objPlayer), ObjMove_GetY(target)-ObjMove_GetY(objPlayer));
|
||||
let atktype = GetEnemyBossSceneObjectID();
|
||||
if(dist <= (GetStgFrameHeight()-100) && atktype != ID_INVALID && ObjEnemy_GetInfo(target, INFO_SHOT_HIT_COUNT) >= 1){
|
||||
|
||||
NotifyEventAll(EV_PIV_250, [ObjMove_GetX(target), ObjMove_GetY(target)]);
|
||||
wait(maxrate + addrate*floor(dist/adddist));
|
||||
|
||||
}
|
||||
else{yield;}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function <int> _Create2DImage(imgpath, int[] rectarray){
|
||||
|
||||
int imgname = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
ObjPrim_SetTexture(imgname, imgpath);
|
||||
ObjSprite2D_SetSourceRect(imgname, rectarray);
|
||||
ObjSprite2D_SetDestCenter(imgname);
|
||||
//ObjRender_SetPosition(imgname, positionstart)
|
||||
|
||||
return imgname;
|
||||
}
|
||||
|
||||
task _DeathbombWarning(imgpath, int[] imgrectarray, int deathbombframes, float basescale){
|
||||
|
||||
int circle = _Create2DImage(imgpath, imgrectarray);
|
||||
Obj_SetRenderPriorityI(circle, 75);
|
||||
ObjRender_SetAlpha(circle, 255);
|
||||
ObjRender_SetPosition(circle, ObjRender_GetX(GetPlayerObjectID()), ObjRender_GetY(GetPlayerObjectID()), 1);
|
||||
ObjRender_SetBlendType(circle, BLEND_INV_DESTRGB);
|
||||
|
||||
ascent(i in 0..deathbombframes-1){
|
||||
ObjRender_SetScaleXYZ(circle, Interpolate_Accelerate(basescale, 0, i/(deathbombframes-1)));
|
||||
yield;
|
||||
}
|
||||
|
||||
Obj_Delete(circle);
|
||||
return;
|
||||
|
||||
}
|
|
@ -0,0 +1,898 @@
|
|||
|
||||
// SYSTEM FOR STATION GAME
|
||||
|
||||
let dirCurrent = GetCurrentScriptDirectory();
|
||||
|
||||
// Change accordingly!
|
||||
|
||||
int offsetX = 1551;
|
||||
int baseY = 155;
|
||||
int spaceY = 135;
|
||||
float scale = 1.15*1.6;
|
||||
|
||||
int sel = 0;
|
||||
|
||||
// Item, life, spell graphics
|
||||
|
||||
let graphicimg = dirCurrent ~ "./img/yo.png";
|
||||
let lifebarimg = dirCurrent ~ "./img/lifebar.png";
|
||||
LoadTextureEx(graphicimg, true, true);
|
||||
|
||||
let pointerPIV = LoadAreaCommonDataValuePointer("PIV", "currentvalue", 10000);
|
||||
|
||||
//#include "./../script/soundtask.txt"
|
||||
|
||||
#include "script/KevinSystem/Init.dnh"
|
||||
#include "script/KevinSystem/kevin_system/Lib_Const.dnh"
|
||||
#include "script/KevinSystem/GeneralSoundLib.txt"
|
||||
#include "script/default_system/Default_Effect.txt"
|
||||
#include "script/KevinSystem/kevin_system/Kevin_EffectLib.dnh"
|
||||
|
||||
@Initialize
|
||||
{
|
||||
|
||||
_SoundTask();
|
||||
|
||||
SetAreaCommonData("ScriptID", "SystemID", GetOwnScriptID());
|
||||
|
||||
//SetCommonDataPtr("SystemIDPtr", GetOwnScriptID());
|
||||
|
||||
SetStgFrame(504, 0, 1415, 997, 20, 80);
|
||||
|
||||
sel = prand_int(0, 99);
|
||||
|
||||
SetPauseScriptPath(GetCurrentScriptDirectory() ~ "kevin_system/Kevin_Pause.txt");
|
||||
SetEndSceneScriptPath(GetCurrentScriptDirectory() ~ "kevin_system/Kevin_EndScene.txt");
|
||||
SetReplaySaveSceneScriptPath(GetCurrentScriptDirectory() ~ "kevin_system/Kevin_ReplaySave.txt");
|
||||
|
||||
InitEffect();
|
||||
InitFrame();
|
||||
|
||||
//TInstallFont(); Moved to package.
|
||||
|
||||
TScore();
|
||||
//TGraze();
|
||||
//SetPlayerLife(9);
|
||||
|
||||
LifeDisplay();
|
||||
SpellDisplay();
|
||||
|
||||
//THighScore();
|
||||
TValueDisplay();
|
||||
|
||||
StartItemScript(dirCurrent ~ "./kevin_system/KevinSystem_Item.txt");
|
||||
|
||||
TExtendSystem();
|
||||
//TBossLife(); // This function is commented out because the caravan stage is handled in a single.
|
||||
TBossTimer();
|
||||
TCurrentFps();
|
||||
TReplayFps();
|
||||
//_SoundTask;
|
||||
}
|
||||
|
||||
@MainLoop
|
||||
{
|
||||
yield;
|
||||
}
|
||||
|
||||
@Event
|
||||
{
|
||||
alternative(GetEventType())
|
||||
|
||||
case(EV_START_BOSS_SPELL)
|
||||
{
|
||||
let path = dirCurrent ~ "Default_System_MagicCircle.txt";
|
||||
let id = LoadScript(path);
|
||||
StartScript(id);
|
||||
}
|
||||
|
||||
case(EV_GAIN_SPELL)
|
||||
{
|
||||
let objScene = GetEnemyBossSceneObjectID();
|
||||
let spellbonus = ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE);
|
||||
TScoreAward(spellbonus);
|
||||
}
|
||||
|
||||
// Arguments: [enemy x, y], particle list to use
|
||||
|
||||
case(EV_EXPLODE)
|
||||
{
|
||||
float[] pos = GetEventArgument(0);
|
||||
//int listTarget = GetEventArgument(1);
|
||||
|
||||
//_EffectListPreRender(PetalEffect, imgEffect, [0, 0, 256, 256]);
|
||||
_ExplosionEffect(pos[0], pos[1], PetalEffect);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function CreateTextObject(
|
||||
float mx, my, size,
|
||||
string text, font,
|
||||
int colorTop, colorBottom,
|
||||
int borderColor, borderWidth,
|
||||
int renderPriority
|
||||
){
|
||||
|
||||
let obj = ObjText_Create();
|
||||
ObjText_SetText(obj, text);
|
||||
ObjText_SetFontSize(obj, size);
|
||||
ObjText_SetFontType(obj, font);
|
||||
ObjText_SetFontColorTop(obj, colorTop);
|
||||
ObjText_SetFontColorBottom(obj, colorBottom);
|
||||
ObjText_SetFontBorderType(obj, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(obj, borderColor);
|
||||
ObjText_SetFontBorderWidth(obj, borderWidth);
|
||||
Obj_SetRenderPriorityI(obj, renderPriority);
|
||||
ObjRender_SetX(obj, mx);
|
||||
ObjRender_SetY(obj, my);
|
||||
return obj;
|
||||
|
||||
}
|
||||
|
||||
// Grants extends based on score
|
||||
|
||||
task TExtendSystem(){
|
||||
|
||||
// NEXT: Text (y around 650?) (x around 2250?)
|
||||
|
||||
/*let NextText =
|
||||
|
||||
CreateTextObject(
|
||||
1625, 465, 30,
|
||||
"NEXT:", "Connecting Chain Handserif",
|
||||
0xA70053, 0xA70053,
|
||||
0xFFFFFF, 2,
|
||||
1
|
||||
);*/
|
||||
|
||||
//ObjText_SetFontBold(NextText, true);
|
||||
// Indicates the score threshold needed for the next extend
|
||||
|
||||
/*let ExtendThresholdText =
|
||||
|
||||
CreateTextObject(
|
||||
250, 960, 24,
|
||||
"", "Exotc350 DmBd BT",
|
||||
0xA70053, 0xA70053,
|
||||
0xFFFFFF, 2,
|
||||
21
|
||||
);
|
||||
|
||||
ObjText_SetFontBold(ExtendThresholdText, true);
|
||||
ObjText_SetHorizontalAlignment(ExtendThresholdText, ALIGNMENT_RIGHT);*/
|
||||
|
||||
int count = 0;
|
||||
// Millions
|
||||
let req = [
|
||||
|
||||
];
|
||||
|
||||
if(GetCommonData("Difficulty", "Normal") == "Normal"){req = [250, 500, 1000, 2500, 5000, 10000];}
|
||||
else{req = [250, 500, 1000, 2500, 5000, 10000];}
|
||||
|
||||
let next = 0;
|
||||
|
||||
loop{
|
||||
count = (trunc(GetScore())/10)*10;
|
||||
if(next <= length(req)-1){
|
||||
if(count >= req[next]*1000000){
|
||||
next++;
|
||||
SetPlayerLife(GetPlayerLife+1);
|
||||
ExtendSFX;
|
||||
ExtendEffect;
|
||||
}
|
||||
}
|
||||
/*if(next != 8){ObjText_SetText(ExtendThresholdText, "NEXT: " ~ DigitToCommaArray(req[next]*1000000));}
|
||||
else{ObjText_SetText(ExtendThresholdText, "MAX EXTEND");}*/
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
task ExtendEffect(){
|
||||
|
||||
int time = 30;
|
||||
int timeDisappear = 30;
|
||||
|
||||
float x = GetPlayerX();
|
||||
float y = GetPlayerY()-90;
|
||||
|
||||
int extendText = CreateTextObject(
|
||||
x, y, 75,
|
||||
"Life[r]Extend!", "Exotc350 DmBd BT",
|
||||
0xFF61AE, 0xFFFFFF,
|
||||
0x5E0064, 6,
|
||||
42
|
||||
);
|
||||
|
||||
ObjText_SetLinePitch(extendText, -2);
|
||||
ObjText_SetFontBold(extendText, true);
|
||||
ObjText_SetHorizontalAlignment(extendText, ALIGNMENT_CENTER);
|
||||
|
||||
ascent(i in 0..time){
|
||||
ObjRender_SetY(extendText, Interpolate_Decelerate(y, y-120, i/time));
|
||||
yield;
|
||||
}
|
||||
|
||||
wait(15);
|
||||
|
||||
ascent(i in 0..timeDisappear){
|
||||
ObjRender_SetAlpha(extendText, Interpolate_Decelerate(255, 0, i/timeDisappear));
|
||||
yield;
|
||||
}
|
||||
Obj_Delete(extendText);
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//枠外の背景表示
|
||||
//----------------------------------------------------
|
||||
function InitFrame()
|
||||
{
|
||||
let path = GetCurrentScriptDirectory() ~ "img/ThiccHUD.png";
|
||||
//if(false){path = GetCurrentScriptDirectory() ~ "img/literallywhat.png";}
|
||||
//else{path = GetCurrentScriptDirectory() ~ "img/altHUD.png";}
|
||||
let obj = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
LoadTextureEx(path, true, true);
|
||||
ObjPrim_SetTexture(obj, path);
|
||||
//ObjRender_SetScaleXYZ(obj, 0.5, 0.5, 1);
|
||||
ObjRender_SetTextureFilterMag(obj, FILTER_NONE);
|
||||
ObjRender_SetTextureFilterMin(obj, FILTER_NONE);
|
||||
ObjRender_SetTextureFilterMip(obj, FILTER_NONE);
|
||||
Obj_SetRenderPriority(obj, 0);
|
||||
ObjSprite2D_SetSourceRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight());
|
||||
ObjSprite2D_SetDestRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight());
|
||||
|
||||
int diffText = CreateTextObject(
|
||||
offsetX+150, baseY*0.3, 60,
|
||||
"", "Exotc350 DmBd BT",
|
||||
0xFFFFFF, 0xFFFFFF,
|
||||
0xFFFFFF, 3,
|
||||
1
|
||||
);
|
||||
|
||||
ObjText_SetFontBold(diffText, true);
|
||||
ObjText_SetHorizontalAlignment(diffText, ALIGNMENT_CENTER);
|
||||
|
||||
/*
|
||||
if(GetCommonData("Difficulty", "Hard") == "Hard"){
|
||||
ObjText_SetText(diffText, "Hard Mode");
|
||||
ObjText_SetFontColorTop(diffText, 0x8100CE);
|
||||
ObjText_SetFontColorBottom(diffText,0xAC7DFF);
|
||||
ObjText_SetFontBorderType(diffText, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(diffText, 0xFFFFFF);
|
||||
}
|
||||
|
||||
else{
|
||||
ObjText_SetText(diffText, "Normal Mode");
|
||||
ObjText_SetFontColorTop(diffText, 0xFF993F);
|
||||
ObjText_SetFontColorBottom(diffText,0xFFCFA6);
|
||||
ObjText_SetFontBorderType(diffText, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(diffText, 0xFFFFFF);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//スコア表示
|
||||
//----------------------------------------------------
|
||||
|
||||
task THighScore(){
|
||||
|
||||
let objScoreNo = ObjText_Create();
|
||||
ObjText_SetFontSize(objScoreNo, 58);
|
||||
ObjText_SetFontBold(objScoreNo, true);
|
||||
ObjText_SetFontType(objScoreNo, "Anke Calligraph");
|
||||
ObjText_SetFontColorTop(objScoreNo, 0xFFA157);
|
||||
ObjText_SetFontColorBottom(objScoreNo,0xFFC232);
|
||||
ObjText_SetFontBorderType(objScoreNo, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objScoreNo, 0xFFFFFF);
|
||||
ObjText_SetFontBorderWidth(objScoreNo, 3);
|
||||
//ObjText_SetFontWeight(objScoreNo, 1000);
|
||||
Obj_SetRenderPriorityI(objScoreNo, 1);
|
||||
ObjRender_SetX(objScoreNo, offsetX-10); // Subject to change
|
||||
ObjRender_SetY(objScoreNo, baseY*0.8); // Same as above
|
||||
|
||||
while(true){
|
||||
let score = GetAreaCommonData("hiscoredata", "hiscore", 0);
|
||||
score = min(score,999999999990);
|
||||
let yass = DigitToCommaArray(score);
|
||||
ObjText_SetText(objScoreNo, yass);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
task TScore(){
|
||||
// New score system using rtos
|
||||
|
||||
// For score with zeroes at the end: Truncate score/10, and then multiply it by 10
|
||||
|
||||
let objScore = ObjText_Create();
|
||||
ObjText_SetFontSize(objScore, 24);
|
||||
ObjText_SetFontBold(objScore, true);
|
||||
ObjText_SetFontType(objScore, "Exotc350 DmBd BT");
|
||||
ObjText_SetFontColorTop(objScore,0xFFFFFF);
|
||||
ObjText_SetFontColorBottom(objScore,0xFFFFFF);
|
||||
ObjText_SetFontBorderType(objScore, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objScore, 0x25379D);
|
||||
ObjText_SetFontBorderWidth(objScore, 3);
|
||||
ObjText_SetText(objScore, "SCORE");
|
||||
//ObjText_SetFontWeight(objScore, 1000);
|
||||
Obj_SetRenderPriorityI(objScore, 79);
|
||||
ObjRender_SetX(objScore, 12); // Subject to change
|
||||
ObjRender_SetY(objScore, 48); // Same as above
|
||||
Obj_SetVisible(objScore, false);
|
||||
|
||||
let objScoreNo = ObjText_Create();
|
||||
ObjText_SetFontSize(objScoreNo, 40);
|
||||
ObjText_SetFontBold(objScoreNo, true);
|
||||
ObjText_SetFontType(objScoreNo, "Origami Mommy");
|
||||
ObjText_SetFontColorTop(objScoreNo,0xFFFFFF);
|
||||
ObjText_SetFontColorBottom(objScoreNo,0xFFFFFF);
|
||||
ObjText_SetFontBorderType(objScoreNo, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objScoreNo, 0x25379D);
|
||||
ObjText_SetFontBorderWidth(objScoreNo, 4);
|
||||
//ObjText_SetFontWeight(objScoreNo, 1000);
|
||||
Obj_SetRenderPriorityI(objScoreNo, 79);
|
||||
ObjText_SetSidePitch(objScoreNo, -3);
|
||||
ObjRender_SetX(objScoreNo, 10); // Subject to change
|
||||
ObjRender_SetY(objScoreNo, 10); // Same as above
|
||||
|
||||
while(true){
|
||||
let score = trunc(GetScore()/10) * 10;
|
||||
score = min(score,999999999990);
|
||||
let yass = DigitToCommaArray(score);
|
||||
ObjText_SetText(objScoreNo, yass);
|
||||
|
||||
if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){
|
||||
ObjRender_SetAlpha(objScore, 60);
|
||||
ObjRender_SetAlpha(objScoreNo, 60);
|
||||
}
|
||||
else{
|
||||
ObjRender_SetAlpha(objScore, 255);
|
||||
ObjRender_SetAlpha(objScoreNo, 255);
|
||||
}
|
||||
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
function DigitToCommaArray(num){ //Natashinitai
|
||||
|
||||
let srcStr = IntToString(num);
|
||||
let res = [];
|
||||
let nChar = 0;
|
||||
for(let i = length(srcStr) - 1; i >= 0; i--){
|
||||
res = [srcStr[i]] ~ res;
|
||||
nChar++;
|
||||
if(nChar % 3 == 0 && i > 0) res = "," ~ res;
|
||||
}
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//Graze表示
|
||||
//----------------------------------------------------
|
||||
task TGraze()
|
||||
{
|
||||
let grazenum = ObjText_Create();
|
||||
ObjText_SetFontSize(grazenum, 58);
|
||||
ObjText_SetFontBold(grazenum, true);
|
||||
ObjText_SetFontType(grazenum, "Anke Calligraph");
|
||||
ObjText_SetFontColorTop(grazenum, 0x8898A3);
|
||||
ObjText_SetFontColorBottom(grazenum, 0xD2E0FF);
|
||||
ObjText_SetFontBorderType(grazenum, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(grazenum, 0xFFFFFF);
|
||||
ObjText_SetFontBorderWidth(grazenum, 3);
|
||||
Obj_SetRenderPriorityI(grazenum, 1);
|
||||
ObjRender_SetX(grazenum, offsetX-10);
|
||||
ObjRender_SetY(grazenum, baseY*0.8+spaceY*5);
|
||||
|
||||
while(true){
|
||||
let graze = GetGraze();
|
||||
|
||||
ObjText_SetText(grazenum, rtos("00000", graze));
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
task TValueDisplay(){
|
||||
|
||||
let objPIV = ObjText_Create();
|
||||
ObjText_SetFontSize(objPIV, 21);
|
||||
ObjText_SetFontBold(objPIV, true);
|
||||
ObjText_SetFontType(objPIV, "Exotc350 DmBd BT");
|
||||
ObjText_SetFontColorTop(objPIV,0xFFFFFF);
|
||||
ObjText_SetFontColorBottom(objPIV,0xFFFFFF);
|
||||
ObjText_SetFontBorderType(objPIV, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objPIV, 0xDC47C8);
|
||||
ObjText_SetFontBorderWidth(objPIV, 3);
|
||||
ObjText_SetText(objPIV, "MULTIPLIER");
|
||||
ObjText_SetHorizontalAlignment(objPIV, ALIGNMENT_RIGHT);
|
||||
//ObjText_SetFontWeight(objPIV, 1000);
|
||||
Obj_SetRenderPriorityI(objPIV, 79);
|
||||
ObjRender_SetX(objPIV, GetStgFrameWidth()-15); // Subject to change
|
||||
ObjRender_SetY(objPIV, 44); // Same as above
|
||||
|
||||
let objPIVNum = ObjText_Create();
|
||||
ObjText_SetFontSize(objPIVNum, 30);
|
||||
ObjText_SetFontBold(objPIVNum, true);
|
||||
ObjText_SetFontType(objPIVNum, "Origami Mommy");
|
||||
ObjText_SetFontColorTop(objPIVNum,0xFFFFFF);
|
||||
ObjText_SetFontColorBottom(objPIVNum,0xFFFFFF);
|
||||
ObjText_SetFontBorderType(objPIVNum, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objPIVNum, 0xDC47C8);
|
||||
ObjText_SetFontBorderWidth(objPIVNum, 4);
|
||||
ObjText_SetHorizontalAlignment(objPIVNum, ALIGNMENT_RIGHT);
|
||||
//ObjText_SetFontWeight(objPIVNum, 1000);
|
||||
Obj_SetRenderPriorityI(objPIVNum, 79);
|
||||
ObjRender_SetX(objPIVNum, GetStgFrameWidth()-12); // Subject to change
|
||||
ObjRender_SetY(objPIVNum, 10); // Same as above
|
||||
// DEBUG
|
||||
//Obj_SetVisible(objPIV, false);
|
||||
|
||||
int value = 0;
|
||||
|
||||
while(true){
|
||||
value = min(GetCommonDataPtr(pointerPIV, 10000), 9999999990);
|
||||
//PIVMultiplierValue = value/1000;
|
||||
let yass = vtos("5.2f", value/10000);
|
||||
ObjText_SetText(objPIVNum, yass ~ "x");
|
||||
|
||||
if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){
|
||||
ObjRender_SetAlpha(objPIV, 60);
|
||||
ObjRender_SetAlpha(objPIVNum, 60);
|
||||
}
|
||||
else{
|
||||
ObjRender_SetAlpha(objPIV, 255);
|
||||
ObjRender_SetAlpha(objPIVNum, 255);
|
||||
}
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//残機表示
|
||||
//----------------------------------------------------
|
||||
/*task TPlayerLife
|
||||
{
|
||||
let lifenum = ObjText_Create();
|
||||
ObjText_SetFontSize(lifenum, 22);
|
||||
ObjText_SetFontBold(lifenum, false);
|
||||
ObjText_SetFontType(lifenum, "Unispace");
|
||||
ObjText_SetFontColorTop(lifenum,255,255,255);
|
||||
ObjText_SetFontColorBottom(lifenum,255,255,255);
|
||||
Obj_SetRenderPriorityI(lifenum, 1);
|
||||
ObjRender_SetX(lifenum,507);
|
||||
ObjRender_SetY(lifenum,101);
|
||||
|
||||
while(true){
|
||||
let liferemain = GetPlayerLife();
|
||||
|
||||
ObjText_SetText(lifenum, rtos("00", liferemain));
|
||||
yield;
|
||||
}
|
||||
}*/
|
||||
|
||||
//----------------------------------------------------
|
||||
//残スペル表示
|
||||
//----------------------------------------------------
|
||||
task TPlayerSpell
|
||||
{
|
||||
let spellnum = ObjText_Create();
|
||||
ObjText_SetFontSize(spellnum, 22);
|
||||
ObjText_SetFontBold(spellnum, false);
|
||||
ObjText_SetFontType(spellnum, "Unispace");
|
||||
ObjText_SetFontColorTop(spellnum,255,255,255);
|
||||
ObjText_SetFontColorBottom(spellnum,255,255,255);
|
||||
Obj_SetRenderPriorityI(spellnum, 1);
|
||||
ObjRender_SetX(spellnum,offsetX);
|
||||
ObjRender_SetY(spellnum,baseY+spaceY*3);
|
||||
|
||||
while(true){
|
||||
let spellremain = GetPlayerSpell();
|
||||
|
||||
ObjText_SetText(spellnum, rtos("00", spellremain));
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
// New life task
|
||||
task LifeDisplay(){
|
||||
|
||||
// oh god oh no
|
||||
let liferemain;
|
||||
let lifecounter = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
|
||||
let lifeshow = graphicimg;
|
||||
Obj_SetRenderPriorityI(lifecounter, 1);
|
||||
ObjPrim_SetTexture(lifecounter, lifeshow);
|
||||
//ObjSpriteList2D_SetSourceRect(lifecounter, 256, 0, 384, 128);
|
||||
//ObjRender_SetScaleXYZ(lifecounter, 0.5, 0.5, 1);
|
||||
//ObjSpriteList2D_SetDestCenter(lifecounter);
|
||||
|
||||
loop{
|
||||
ObjSpriteList2D_ClearVertexCount(lifecounter);
|
||||
ObjSpriteList2D_SetSourceRect(lifecounter, 256, 0, 384, 128);
|
||||
ObjSpriteList2D_SetDestCenter(lifecounter);
|
||||
ObjRender_SetScaleXYZ(lifecounter, 0.26*scale, 0.26*scale, 1);
|
||||
liferemain = GetPlayerLife();
|
||||
ascent(i in 0..liferemain){
|
||||
ObjRender_SetPosition(lifecounter, 550-10+i*25, 1040, 0);
|
||||
ObjSpriteList2D_AddVertex(lifecounter);
|
||||
}
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
// New spell task
|
||||
task SpellDisplay{
|
||||
|
||||
int text = CreateTextObject(
|
||||
1270, 1022, 30,
|
||||
"MAX BOMB!", "Origami Mommy",
|
||||
0xFFFFFF, 0xFFFFFF,
|
||||
0x6600BE, 6,
|
||||
2
|
||||
);
|
||||
|
||||
Obj_SetVisible(text, false);
|
||||
ObjText_SetSidePitch(text, -4);
|
||||
ObjText_SetHorizontalAlignment(text, ALIGNMENT_CENTER);
|
||||
|
||||
let spellremain;
|
||||
let spellcounter = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
|
||||
let spellshow = graphicimg;
|
||||
Obj_SetRenderPriorityI(spellcounter, 1);
|
||||
ObjPrim_SetTexture(spellcounter, spellshow);
|
||||
|
||||
loop{
|
||||
if(GetPlayerSpell() > 5){SetPlayerSpell(5);}
|
||||
if(GetPlayerSpell() == 5){Obj_SetVisible(text, true);}
|
||||
else{Obj_SetVisible(text, false);}
|
||||
ObjSpriteList2D_ClearVertexCount(spellcounter);
|
||||
ObjSpriteList2D_SetSourceRect(spellcounter, 384, 0, 512, 128);
|
||||
ObjSpriteList2D_SetDestCenter(spellcounter);
|
||||
ObjRender_SetScaleXYZ(spellcounter, 0.26*scale, 0.26*scale, 1);
|
||||
spellremain = GetPlayerSpell();
|
||||
ascent(i in 0..spellremain){
|
||||
ObjRender_SetPosition(spellcounter, 1000+10+i*25, 1040, 0);
|
||||
ObjSpriteList2D_AddVertex(spellcounter);
|
||||
}
|
||||
yield;
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------
|
||||
// Edited ExRumia system
|
||||
//----------------------------------------------------
|
||||
task TBossLife
|
||||
|
||||
// Lifebar starts at x = 352, ends at x = 925
|
||||
{
|
||||
let path = lifebarimg;
|
||||
let obj = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
|
||||
let objStar = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
|
||||
let objDivision = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
|
||||
let objLifebar = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
|
||||
//bool BossExist = false;
|
||||
|
||||
ObjPrim_SetTexture(obj, path);
|
||||
Obj_SetRenderPriorityI(obj, 72);
|
||||
ObjRender_SetAlpha(obj, 255);
|
||||
|
||||
ObjPrim_SetTexture(objStar, path);
|
||||
Obj_SetRenderPriorityI(objStar, 70);
|
||||
|
||||
ObjPrim_SetTexture(objDivision, path);
|
||||
Obj_SetRenderPriorityI(objDivision, 72);
|
||||
|
||||
ObjPrim_SetTexture(objLifebar, path);
|
||||
Obj_SetRenderPriorityI(objLifebar, 70);
|
||||
ObjRender_SetAlpha(objLifebar, 140);
|
||||
//Obj_SetVisible(objLifebar, false);
|
||||
|
||||
let lastRemStep = -1;
|
||||
let lifeRateRender = 0;
|
||||
|
||||
let objScene = ID_INVALID;
|
||||
loop
|
||||
{
|
||||
objScene = GetEnemyBossSceneObjectID();
|
||||
ObjSpriteList2D_ClearVertexCount(obj);
|
||||
ObjSpriteList2D_ClearVertexCount(objLifebar);
|
||||
ObjSpriteList2D_ClearVertexCount(objStar);
|
||||
ObjSpriteList2D_ClearVertexCount(objDivision);
|
||||
if(objScene != ID_INVALID)
|
||||
{
|
||||
//BossExist = true;
|
||||
ObjSpriteList2D_SetSourceRect(objLifebar, 8, 6, 801, 50);
|
||||
ObjSpriteList2D_SetDestCenter(objLifebar);
|
||||
ObjRender_SetScaleXYZ(objLifebar, 1.12, 1.25, 1);
|
||||
ascent (i in 0..1){
|
||||
ObjRender_SetPosition(objLifebar, 455, 90, 1);
|
||||
ObjSpriteList2D_AddVertex(objLifebar);
|
||||
}
|
||||
RenderActiveLife();
|
||||
|
||||
}
|
||||
yield;
|
||||
}
|
||||
|
||||
/*task RenderLifebar(){
|
||||
ObjSprite2D_SetSourceRect(objLifebar, 5, 5, 534, 34);
|
||||
ObjSprite2D_SetDestCenter(objLifebar);
|
||||
ObjRender_SetPosition(objLifebar, 352, 20, 1);
|
||||
while(BossExist){
|
||||
Obj_SetVisible(objLifebar, true);
|
||||
yield;
|
||||
}
|
||||
}*/
|
||||
|
||||
function RenderActiveLife()
|
||||
{
|
||||
//残りステップ
|
||||
let countRemStep = ObjEnemyBossScene_GetInfo(objScene, INFO_REMAIN_STEP_COUNT);
|
||||
if(lastRemStep != countRemStep)
|
||||
{
|
||||
//ステップが変化
|
||||
lifeRateRender = 0;
|
||||
}
|
||||
|
||||
//Overall active life
|
||||
let lifeTotalMax = ObjEnemyBossScene_GetInfo(objScene, INFO_ACTIVE_STEP_TOTAL_MAX_LIFE);
|
||||
let lifeTotal = ObjEnemyBossScene_GetInfo(objScene, INFO_ACTIVE_STEP_TOTAL_LIFE);
|
||||
let lifeRate = min(lifeTotal / lifeTotalMax, lifeRateRender);
|
||||
ObjSpriteList2D_SetSourceRect(obj, 7, 119, 800, 159);
|
||||
ObjSpriteList2D_SetDestRect(obj, 11, 70, 12 + (890-2) * lifeRate, 110);
|
||||
ObjRender_SetColorHSV(obj, -60, 384, 384);
|
||||
ObjSpriteList2D_AddVertex(obj);
|
||||
ObjRender_SetBlendType(obj, BLEND_ALPHA);
|
||||
|
||||
//Life "division" bar
|
||||
ObjSpriteList2D_SetSourceRect(objDivision, 8, 56, 27, 111);
|
||||
//ObjRender_SetColorHSV(objDivision, 32, 255, 255);
|
||||
let listLifeDiv = [0] ~ ObjEnemyBossScene_GetInfo(objScene, INFO_ACTIVE_STEP_LIFE_RATE_LIST);
|
||||
ascent(iDiv in 1 .. length(listLifeDiv)-1)
|
||||
{
|
||||
let rate = listLifeDiv[iDiv];
|
||||
let x = (GetStgFrameWidth()) * 0.98 * (1-rate);
|
||||
ObjSpriteList2D_SetDestRect(objDivision, x-4, 62, x+24, 118);
|
||||
ObjSpriteList2D_AddVertex(objDivision);
|
||||
}
|
||||
|
||||
//Boss star rendering
|
||||
ObjRender_SetScaleXYZ(objStar, 0.6, 0.6, 1);
|
||||
ObjSpriteList2D_SetSourceRect(objStar, 0, 169, 268, 430);
|
||||
Obj_SetRenderPriority(objStar, 1);
|
||||
ascent(iStep in 0 .. countRemStep)
|
||||
{
|
||||
ObjRender_SetPosition(objStar, GetStgFrameWidth()*1.6, 35+45*iStep, 1);
|
||||
ObjSpriteList2D_SetDestCenter(objStar);
|
||||
ObjSpriteList2D_AddVertex(objStar);
|
||||
}
|
||||
|
||||
lifeRateRender += 0.01;
|
||||
lifeRateRender = min(lifeRateRender, 1);
|
||||
lastRemStep = countRemStep;
|
||||
|
||||
if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){
|
||||
ObjRender_SetAlpha(obj, 60);
|
||||
ObjRender_SetAlpha(obj, 30);
|
||||
}
|
||||
else{
|
||||
ObjRender_SetAlpha(obj, 255);
|
||||
ObjRender_SetAlpha(objLifebar, 140);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//タイマー表示
|
||||
//----------------------------------------------------
|
||||
task TBossTimer
|
||||
{
|
||||
let textTimer = ObjText_Create();
|
||||
ObjText_SetFontSize(textTimer, 60);
|
||||
ObjText_SetFontType(textTimer, "Origami Mommy");
|
||||
|
||||
//ObjText_SetMaxWidth(textTimer, GetStgFrameWidth()/6);
|
||||
ObjText_SetHorizontalAlignment(textTimer, ALIGNMENT_LEFT);
|
||||
|
||||
ObjText_SetFontBold(textTimer, true);
|
||||
ObjText_SetFontColorTop(textTimer, 0xFFFFFF);
|
||||
ObjText_SetFontColorBottom(textTimer, 0xFFFFFF);
|
||||
ObjText_SetFontBorderType(textTimer, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(textTimer, 0x45A6FF);
|
||||
ObjText_SetFontBorderWidth(textTimer, 3.4);
|
||||
Obj_SetRenderPriorityI(textTimer, 73);
|
||||
//ObjRender_SetX(textTimer, GetStgFrameWidth()/2);
|
||||
ObjRender_SetX(textTimer, 10);
|
||||
ObjRender_SetY(textTimer, 90);
|
||||
Obj_SetVisible(textTimer, true);
|
||||
|
||||
let pathDigit = GetCurrentScriptDirectory() ~ "img/Default_SystemDigit.png";
|
||||
|
||||
let obj = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
|
||||
ObjPrim_SetTexture(obj, lifebarimg);
|
||||
ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
|
||||
Obj_SetRenderPriority(obj, 0.75);
|
||||
//ObjRender_SetY(obj, 38);
|
||||
let count = 2;
|
||||
|
||||
let objScene = ID_INVALID;
|
||||
loop
|
||||
{
|
||||
objScene = GetEnemyBossSceneObjectID();
|
||||
ObjSpriteList2D_ClearVertexCount(obj);
|
||||
if(objScene != ID_INVALID)
|
||||
{
|
||||
Obj_SetVisible(textTimer, true);
|
||||
RenderTimer();
|
||||
}
|
||||
else{Obj_SetVisible(textTimer, false);
|
||||
}
|
||||
yield;
|
||||
}
|
||||
|
||||
task RenderTimer()
|
||||
{
|
||||
let timer = ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF)/60;
|
||||
timer = min(timer, 99.99);
|
||||
ObjText_SetText(textTimer, rtos("00.00", timer));
|
||||
ObjSpriteList2D_SetSourceRect(obj, 404, 225, 537, 374);
|
||||
ObjRender_SetScaleXYZ(obj, 0.45, 0.45, 1);
|
||||
ObjSpriteList2D_SetDestCenter(obj);
|
||||
ObjRender_SetPosition(obj, 4*GetStgFrameWidth()/5+62, GetStgFrameHeight()/8-25, 1);
|
||||
//ObjSpriteList2D_AddVertex(obj);
|
||||
if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= 10 && ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) > 0){
|
||||
if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF) % 60 == 0 || ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) < 1){_Timeout();}
|
||||
ObjText_SetFontBorderColor(textTimer, 0xF0396C);
|
||||
}
|
||||
else{ObjText_SetFontBorderColor(textTimer, 0x45A6FF); ObjText_SetFontSize(textTimer, 60);}
|
||||
if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){
|
||||
ObjRender_SetAlpha(textTimer, 60);
|
||||
}
|
||||
else{
|
||||
ObjRender_SetAlpha(textTimer, 255);
|
||||
}
|
||||
yield;
|
||||
}
|
||||
|
||||
task _Timeout(){ // HOLY FUCK THE TIMER IS RUNNING OUT BITCH
|
||||
|
||||
ascent(i in 0..30){
|
||||
ObjText_SetFontSize(textTimer, Interpolate_Decelerate(100, 60, i/30));
|
||||
//ObjRender_SetScaleXYZ(obj, Interpolate_Decelerate(0.6, 0.38, i/30));
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
task TScoreAward(dascore){
|
||||
|
||||
let objText = ObjText_Create();
|
||||
int x = rand_int(0, 99);
|
||||
|
||||
RegularAward;
|
||||
|
||||
task RegularAward{
|
||||
|
||||
let fontsizearray = [70, 70, 70, 65, 60, 65, 70, 70, 70, 40, 40];
|
||||
let textarray = ["So Cool Bestie!", "Bimbo Eliminated!", "Wig Snatched!", "Neutralized Boss Sexiness!", "Gay Rights Confirmed!", "Himbo Kisses!", "Slay Button Hit!", "Yass!!!!", "Gatekept, Gaslit, Girlbossed!", "Spell Card Capture!"];
|
||||
|
||||
int y = rand_int(0, length(textarray)-2);
|
||||
|
||||
ObjText_SetText(objText, textarray[y]); // Selects a random capture text from the array
|
||||
ObjText_SetFontSize(objText, fontsizearray[y]*1.5);
|
||||
ObjText_SetFontType(objText, "Exotc350 DmBd BT");
|
||||
|
||||
//ObjText_SetMaxWidth(objText, GetStgFrameWidth());
|
||||
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
|
||||
|
||||
ObjText_SetFontBold(objText, true);
|
||||
ObjText_SetFontColorTop(objText, 0xFFD34D);
|
||||
ObjText_SetFontColorBottom(objText, 0xFFF2CA);
|
||||
ObjText_SetFontBorderType(objText, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objText,0, 0, 0);
|
||||
ObjText_SetFontBorderWidth(objText, 3);
|
||||
Obj_SetRenderPriority(objText, 0.6);
|
||||
ObjRender_SetX(objText, GetStgFrameWidth()/2);
|
||||
ObjRender_SetY(objText, GetStgFrameHeight()/5);
|
||||
}
|
||||
|
||||
let scorefinal = trunc(dascore/10) * 10;
|
||||
let scorescene = GetEnemyBossSceneObjectID();
|
||||
|
||||
if (ObjEnemyBossScene_GetInfo(scorescene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 &&
|
||||
ObjEnemyBossScene_GetInfo(scorescene, INFO_PLAYER_SPELL_COUNT) == 0){
|
||||
AddScore(scorefinal);
|
||||
}
|
||||
|
||||
let strScore = "Capture Bonus +" ~ DigitToCommaArray(scorefinal);
|
||||
let objScore = ObjText_Create();
|
||||
ObjText_SetText(objScore, strScore);
|
||||
ObjText_SetFontSize(objScore, 85);
|
||||
ObjText_SetFontType(objScore, "Anke Calligraph");
|
||||
|
||||
ObjText_SetMaxWidth(objScore, GetStgFrameWidth());
|
||||
ObjText_SetHorizontalAlignment(objScore, ALIGNMENT_CENTER);
|
||||
|
||||
ObjText_SetFontBold(objScore, true);
|
||||
ObjText_SetFontColorTop(objScore, 0x9C2400);
|
||||
ObjText_SetFontColorBottom(objScore, 0xFF982A);
|
||||
ObjText_SetFontBorderType(objScore, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objScore, 255, 255, 255);
|
||||
ObjText_SetFontBorderWidth(objScore, 3);
|
||||
Obj_SetRenderPriority(objScore, 0.6);
|
||||
ObjRender_SetX(objScore, GetStgFrameWidth()/2 - (GetStgFrameWidth()/2-5));
|
||||
ObjRender_SetY(objScore, GetStgFrameHeight()/3.2-15);
|
||||
|
||||
wait(120);
|
||||
|
||||
Obj_Delete(objText);
|
||||
Obj_Delete(objScore);
|
||||
|
||||
}
|
||||
//----------------------------------------------------
|
||||
//FPS表示
|
||||
//----------------------------------------------------
|
||||
task TCurrentFps()
|
||||
{
|
||||
let objText = ObjText_Create();
|
||||
ObjText_SetFontSize(objText, 48);
|
||||
ObjText_SetFontBold(objText, true);
|
||||
ObjText_SetFontType(objText, "Anke Calligraph");
|
||||
ObjText_SetFontColorTop(objText, 0x6747FF);
|
||||
ObjText_SetFontColorBottom(objText, 0xAEC4FF);
|
||||
ObjText_SetFontBorderType(objText, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objText, 255, 255, 255);
|
||||
ObjText_SetFontBorderWidth(objText, 1.5);
|
||||
ObjText_SetHorizontalAlignment(objText, ALIGNMENT_RIGHT);
|
||||
ObjText_SetMaxWidth(objText, GetScreenWidth() - 8);
|
||||
Obj_SetRenderPriority(objText, 1.0);
|
||||
ObjRender_SetX(objText, 0);
|
||||
ObjRender_SetY(objText, GetScreenHeight() - 48);
|
||||
|
||||
loop
|
||||
{
|
||||
let fps = GetCurrentFps();
|
||||
let text = vtos("1.2f", fps) ~ "fps";
|
||||
ObjText_SetText(objText, text);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
task TReplayFps()
|
||||
{
|
||||
if(!IsReplay()){return;}
|
||||
|
||||
let objText = ObjText_Create();
|
||||
ObjText_SetFontSize(objText, 12);
|
||||
ObjText_SetFontBold(objText, true);
|
||||
ObjText_SetFontColorTop(objText, 128, 128, 255);
|
||||
ObjText_SetFontColorBottom(objText, 64, 64, 255);
|
||||
ObjText_SetFontBorderType(objText, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objText,255, 255, 255);
|
||||
ObjText_SetFontBorderWidth(objText, 1);
|
||||
Obj_SetRenderPriority(objText, 1.0);
|
||||
|
||||
let px = GetStgFrameLeft() + GetStgFrameWidth() - 18;
|
||||
let py = GetStgFrameTop() + GetScreenHeight() - 14;
|
||||
ObjRender_SetX(objText, px);
|
||||
ObjRender_SetY(objText, py);
|
||||
|
||||
loop
|
||||
{
|
||||
let fps = GetReplayFps();
|
||||
let text = vtos("02d", fps);
|
||||
ObjText_SetText(objText, text);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//ユーティリティ
|
||||
//----------------------------------------------------
|
|
@ -0,0 +1,64 @@
|
|||
// Sound effects for player scripts go here.
|
||||
|
||||
// Link to sound folder
|
||||
|
||||
let sddir = GetCurrentScriptDirectory() ~ "./PlayerSFX";
|
||||
//let sddir = GetCurrentScriptDirectory() ~ "./sound";
|
||||
|
||||
let SFXVol = GetAreaCommonData("Config", "SEVol", 100) * 0.01;
|
||||
|
||||
// Function for loading and setting volume of a sound object
|
||||
function LoadEx(targetobj, targetpath, targetvol){
|
||||
|
||||
ObjSound_Load(targetobj, targetpath);
|
||||
ObjSound_SetVolumeRate(targetobj, targetvol * SFXVol);
|
||||
ObjSound_SetSoundDivision(targetobj, SOUND_SE);
|
||||
|
||||
}
|
||||
|
||||
// Universal sounds
|
||||
let baseshot = sddir ~ "./retrolaser.wav";
|
||||
let bomb = sddir ~ "./bfxr_kyliejennerarabqueen.wav";
|
||||
let ded = sddir ~ "./bfxr_PlayerShootdown.wav";
|
||||
let hit = sddir ~ "./bfxr_PlayerHit.wav";
|
||||
let graze = sddir ~ "./bfxr_Graze.wav";
|
||||
|
||||
let basesfx = ObjSound_Create();
|
||||
let bombsfx = ObjSound_Create();
|
||||
let deathsfx = ObjSound_Create();
|
||||
let predeathsfx = ObjSound_Create();
|
||||
let grazesfx = ObjSound_Create();
|
||||
/**/
|
||||
// Marisa & Housui's sounds, "inferno" is shared with Eri/Ten
|
||||
|
||||
let teleporthigh = sddir ~ "./bfxr_teleporthigh.wav";
|
||||
let teleportlow = sddir ~ "./bfxr_teleportlow.wav";
|
||||
let missileboom = ObjSound_Create();
|
||||
let inferno = ObjSound_Create();
|
||||
let bombhousui = ObjSound_Create();
|
||||
|
||||
// Pankevin & Kouda's sounds
|
||||
|
||||
let orbfront = ObjSound_Create();
|
||||
let orbback = ObjSound_Create();
|
||||
let scythecall = ObjSound_Create();
|
||||
let splash = ObjSound_Create();
|
||||
let scythefire = ObjSound_Create();
|
||||
|
||||
task _SoundTask(){
|
||||
LoadEx(basesfx, baseshot, 20);
|
||||
LoadEx(bombsfx, bomb, 75);
|
||||
LoadEx(deathsfx, ded, 40);
|
||||
LoadEx(predeathsfx, hit, 100);
|
||||
|
||||
LoadEx(orbfront, teleporthigh, 20);
|
||||
LoadEx(orbback, teleportlow, 20);
|
||||
LoadEx(scythecall, sddir ~ "./bfxr_scythecall.wav", 15);
|
||||
LoadEx(splash, sddir ~ "./bfxr_splash.wav", 12.5);
|
||||
LoadEx(scythefire, sddir ~ "./bfxr_watershoot.wav", 8);
|
||||
|
||||
LoadEx(missileboom, sddir ~ "./bfxr_missileexplode.wav", 18);
|
||||
LoadEx(inferno, sddir ~ "./retrolaser2.wav", 30);
|
||||
LoadEx(bombhousui, sddir ~ "./bfxr_arabqueenhousama.wav", 35);
|
||||
LoadEx(grazesfx, graze, 40);
|
||||
}
|
|
@ -0,0 +1,844 @@
|
|||
/*
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
UNIVERSAL LIBRARY FOR ENEMY-RELATED FUNCTIONS
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
*/
|
||||
|
||||
#include "script/KevinSystem/kevin_system/Lib_Const.dnh"
|
||||
|
||||
let ITEMID_PTR = LoadAreaCommonDataValuePointer("ScriptID", "ItemID", 0);
|
||||
let SYSTEMID_PTR = LoadAreaCommonDataValuePointer("ScriptID", "SystemID", 0);
|
||||
|
||||
WriteLog(ITEMID_PTR);
|
||||
WriteLog(SYSTEMID_PTR);
|
||||
|
||||
// Code by Kevinmonitor with some assistance.
|
||||
/*
|
||||
|
||||
///////////// ENEMY SPAWNING DURING STAGES /////////////
|
||||
|
||||
*/
|
||||
|
||||
function <int> _InitDifficulty(int diffInt){
|
||||
|
||||
int difficulty = 0;
|
||||
|
||||
if(GetCommonData("Difficulty", "Normal") == "Normal"){
|
||||
difficulty = 0;
|
||||
}
|
||||
|
||||
else if(GetCommonData("Difficulty", "Normal") == "Hard"){
|
||||
difficulty = 1;
|
||||
}
|
||||
|
||||
else if(GetCommonData("Difficulty", "Normal") == "Lunatic"){
|
||||
difficulty = 2;
|
||||
}
|
||||
|
||||
return difficulty;
|
||||
}
|
||||
|
||||
// Explosion Sound Effects
|
||||
|
||||
task _RenderBoss(int enemy){
|
||||
|
||||
int aniidle = 0;
|
||||
|
||||
string tex = "script/game/resourceLib/Spritesheet_StationJam.png";
|
||||
|
||||
LoadTextureEx(tex, true, true);
|
||||
|
||||
ObjPrim_SetTexture(enemy, tex);
|
||||
ObjSprite2D_SetSourceRect(enemy, 1280, 0, 1280+256, 256);
|
||||
ObjSprite2D_SetDestCenter(enemy);
|
||||
ObjRender_SetScaleXYZ(enemy, 1);
|
||||
|
||||
int nameText = CreateTextObject(
|
||||
GetStgFrameWidth()*0.3, 200, 25,
|
||||
"REMILIA SCARLET", "Origami Mommy",
|
||||
0xFF5A5A, 0xFFFFFF,
|
||||
0x791D1D, 3,
|
||||
1
|
||||
);
|
||||
|
||||
ObjRender_SetAngleZ(nameText, -90);
|
||||
ObjText_SetFontBold(nameText, true);
|
||||
|
||||
//_BossMarker(enemy, tex, 512, 0, 768, 256, 0.45, 30);
|
||||
|
||||
while(!Obj_IsDeleted(enemy)){
|
||||
|
||||
yield;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
task _RenderMidboss(int enemy){
|
||||
|
||||
int aniidle = 0;
|
||||
|
||||
string tex = "script/game/StageLib/BossAsset.png";
|
||||
|
||||
LoadTextureEx(tex, true, true);
|
||||
|
||||
int nameText = CreateTextObject(
|
||||
GetStgFrameWidth()*0.38, 10, 42,
|
||||
"MIDBOSS: Kobiko", "Connecting Chain Handserif",
|
||||
0xBA8AFF, 0xFFFFFF,
|
||||
0x552A9C, 3,
|
||||
1
|
||||
);
|
||||
|
||||
ObjText_SetFontBold(nameText, true);
|
||||
ObjPrim_SetTexture(enemy, tex);
|
||||
ObjSprite2D_SetSourceRect(enemy, 768, 0, 768+512, 512);
|
||||
ObjSprite2D_SetDestCenter(enemy);
|
||||
ObjRender_SetScaleXYZ(enemy, 0.5);
|
||||
|
||||
_BossMarker(enemy, tex, 512, 256, 768, 512, 0.45, 30);
|
||||
|
||||
while(!Obj_IsDeleted(enemy)){
|
||||
|
||||
yield;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
task _FadeInSpawn(
|
||||
int enemyID,
|
||||
float spawnX, float spawnY,
|
||||
float destX, float destY,
|
||||
float spawnScale, float destScale,
|
||||
int time){
|
||||
|
||||
ObjMove_SetPosition(enemyID, spawnX, spawnY);
|
||||
ObjRender_SetAlpha(enemyID, 0);
|
||||
|
||||
ObjMove_SetDestAtFrame(enemyID, destX, destY, time, LERP_DECELERATE);
|
||||
|
||||
ascent(i in 0..time){
|
||||
ObjRender_SetAlpha(enemyID, Interpolate_Decelerate(0, 255, i/time));
|
||||
ObjRender_SetScaleXYZ(enemyID, Interpolate_Decelerate(spawnScale, destScale, i/time));
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Creates an enemy and spawns them using _FadeInSpawn. Shooting and movement tasks not covered.
|
||||
// Task also handles deleting the enemy after their life reaches 0.
|
||||
|
||||
/*
|
||||
BhestieBlue: 0, 0, 256, 256
|
||||
BhestieGreen: 256, 0, 512, 256
|
||||
GaySamoyed: 0, 256, 256, 512
|
||||
EvilSamoyed: 256, 256, 512, 512
|
||||
*/
|
||||
|
||||
function <int> _CreateEnemy(
|
||||
float spawnX, float spawnY, float destX, float destY, int spawntime,
|
||||
float spawnScale, float destScale,
|
||||
float health, float sizeHitbox, float sizeHurtbox,
|
||||
texture,
|
||||
int rectLeft, int rectTop, int rectRight, int rectBottom){
|
||||
|
||||
// Essentials
|
||||
int enemyID = ObjEnemy_Create(OBJ_ENEMY);
|
||||
ObjEnemy_Regist(enemyID);
|
||||
ObjEnemy_SetLife(enemyID, health);
|
||||
ObjEnemy_SetAutoDelete(enemyID, true);
|
||||
|
||||
// TBA: Handle animations
|
||||
ObjPrim_SetTexture(enemyID, texture);
|
||||
ObjSprite2D_SetSourceRect(enemyID, rectLeft, rectTop, rectRight, rectBottom);
|
||||
ObjSprite2D_SetDestCenter(enemyID);
|
||||
|
||||
// Spawning
|
||||
_FadeInSpawn(enemyID, spawnX, spawnY, destX, destY, spawnScale, destScale, spawntime);
|
||||
_HandleEnemyWellbeing(enemyID, sizeHitbox, sizeHurtbox);
|
||||
|
||||
return enemyID;
|
||||
|
||||
}
|
||||
|
||||
// Special overload for creating hitbox/hurtboxless enemies.
|
||||
|
||||
function <int> _CreateEnemy(
|
||||
bool intersectionrender,
|
||||
float spawnX, float spawnY, float destX, float destY, int spawntime,
|
||||
float spawnScale, float destScale,
|
||||
float health, float sizeHitbox, float sizeHurtbox,
|
||||
texture,
|
||||
int rectLeft, int rectTop, int rectRight, int rectBottom){
|
||||
|
||||
// Essentials
|
||||
int enemyID = ObjEnemy_Create(OBJ_ENEMY);
|
||||
ObjEnemy_Regist(enemyID);
|
||||
ObjEnemy_SetLife(enemyID, health);
|
||||
ObjEnemy_SetAutoDelete(enemyID, true);
|
||||
|
||||
// TBA: Handle animations
|
||||
ObjPrim_SetTexture(enemyID, texture);
|
||||
ObjSprite2D_SetSourceRect(enemyID, rectLeft, rectTop, rectRight, rectBottom);
|
||||
ObjSprite2D_SetDestCenter(enemyID);
|
||||
|
||||
// Spawning
|
||||
_FadeInSpawn(enemyID, spawnX, spawnY, destX, destY, spawnScale, destScale, spawntime);
|
||||
if (intersectionrender){_HandleEnemyWellbeing(enemyID, sizeHitbox, sizeHurtbox);}
|
||||
else{}
|
||||
|
||||
return enemyID;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Hitbox and deletion
|
||||
|
||||
task _HandleEnemyWellbeing(int enemyID, float sizeHitbox, float sizeHurtbox){
|
||||
|
||||
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);
|
||||
yield;
|
||||
}
|
||||
Obj_Delete(enemyID);
|
||||
}
|
||||
|
||||
|
||||
// Fading invincibility for bosses/enemies (with parameters for wait times and fade times, and a separate multiplier for bomb damage rate (final spells))
|
||||
|
||||
task _FadeInvincibility(int target, int waittime, int fadetime, float bombmultiplier){
|
||||
|
||||
float x = 0;
|
||||
ObjEnemy_SetDamageRate(target, 0, 0);
|
||||
wait(waittime);
|
||||
ascent(i in 0..fadetime){
|
||||
x = Interpolate_Accelerate(0, 100, i/fadetime);
|
||||
ObjEnemy_SetDamageRate(target, x, x*bombmultiplier);
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
///////////// HANDLING THE END OF SINGLES (DURING BOSS/MIDBOSS FIGHTS) /////////////
|
||||
|
||||
To-do: Move item creation to the item script(s)
|
||||
|
||||
*/
|
||||
|
||||
////// NEW //////
|
||||
|
||||
task _GoToBrazil(
|
||||
int targetscene, targetenemy,
|
||||
int maxitemdrop, int minitemdrop){
|
||||
|
||||
while(ObjEnemy_GetInfo(targetenemy, INFO_LIFE)>0){
|
||||
yield;
|
||||
}
|
||||
|
||||
maxitemdrop = 14;
|
||||
minitemdrop = 7;
|
||||
|
||||
int finalItemDrop = 0;
|
||||
let itemType = POINT_RAINBOW;
|
||||
|
||||
int maxTimer = ObjEnemyBossScene_GetInfo(targetscene, INFO_ORGTIMERF);
|
||||
int killTimer = ObjEnemyBossScene_GetInfo(targetscene, INFO_TIMERF);
|
||||
|
||||
bool isnon = ObjEnemyBossScene_GetInfo(targetscene, INFO_IS_SPELL);
|
||||
|
||||
// If the boss is killed within the first 1/5 of the timer, drop full items
|
||||
|
||||
if(killTimer >= maxTimer*(4/5)) {finalItemDrop = maxitemdrop;}
|
||||
|
||||
// Starting from the rest of the timer, the maximum items that can be dropped is equal to 4/5 of the max drop amount
|
||||
|
||||
else{finalItemDrop = Interpolate_Decelerate(minitemdrop, maxitemdrop*(4/5), killTimer/(maxTimer*4/5));}
|
||||
|
||||
// If the player has lost a life, lock the number of items to the lowest possible
|
||||
|
||||
if(ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SHOOTDOWN_COUNT) > 0){
|
||||
finalItemDrop = minitemdrop;
|
||||
//itemType = POINT_REGULAR;
|
||||
}
|
||||
|
||||
DeleteShotAll(TYPE_ALL,TYPE_ITEM);
|
||||
|
||||
SetPlayerInvincibilityFrame(120);
|
||||
|
||||
// Common Data
|
||||
|
||||
NotifyEventAll(EV_SINGLE_ITEM_DROP, ObjMove_GetX(targetenemy), ObjMove_GetY(targetenemy), finalItemDrop, itemType);
|
||||
|
||||
wait(120);
|
||||
|
||||
float[] enemyPos = [ObjMove_GetX(targetenemy), ObjMove_GetY(targetenemy)];
|
||||
|
||||
SetCommonData("Entering PIV", GetAreaCommonData("PIV", "currentvalue", 10000));
|
||||
SetCommonData("Boss Position X", enemyPos[0]);
|
||||
SetCommonData("Boss Position Y", enemyPos[1]);
|
||||
|
||||
Obj_Delete(targetenemy);
|
||||
|
||||
}
|
||||
|
||||
////// OLD/LEGACY //////
|
||||
// Basic post-death handling after every attack (Duo).
|
||||
|
||||
function _GoToBrazilDuo(targetscene, targetenemy, targetenemyA, targetenemyB, returnXA, returnYA, returnXB, returnYB, bool isnon, int itemdropamount){
|
||||
|
||||
while(ObjEnemy_GetInfo(targetenemy, INFO_LIFE) > 0){
|
||||
yield;
|
||||
}
|
||||
|
||||
DeleteShotAll(TYPE_ALL,TYPE_ITEM);
|
||||
SetPlayerInvincibilityFrame(120);
|
||||
|
||||
// returnX and returnY are the boss positions they return to at the end of every pattern. (I'm too lazy for common data...)
|
||||
|
||||
ObjMove_CancelMovement(targetenemyA); ObjMove_CancelMovement(targetenemyB);
|
||||
|
||||
ObjMove_SetDestAtFrame(targetenemyA, returnXA, returnYA, 45, LERP_DECELERATE);
|
||||
ObjMove_SetDestAtFrame(targetenemyB, returnXB, returnYB, 45, LERP_DECELERATE);
|
||||
|
||||
async{
|
||||
wait(45);
|
||||
ObjMove_CancelMovement(targetenemyA); ObjMove_CancelMovement(targetenemyB);
|
||||
ObjMove_SetDestAtFrame(targetenemyA, returnXA, returnYA, 15, LERP_DECELERATE);
|
||||
ObjMove_SetDestAtFrame(targetenemyB, returnXB, returnYB, 15, LERP_DECELERATE);
|
||||
ObjMove_SetProcessMovement(targetenemyA, false);
|
||||
ObjMove_SetProcessMovement(targetenemyB, false);
|
||||
return;
|
||||
}
|
||||
|
||||
alternative(isnon)
|
||||
|
||||
case(true){_NonspellItemDrop(targetscene, targetenemyA, itemdropamount); _NonspellItemDrop(targetscene, targetenemyB, itemdropamount);}
|
||||
|
||||
others{_SpellItemDrop(targetscene, targetenemyA, itemdropamount); _SpellItemDrop(targetscene, targetenemyB, itemdropamount);}
|
||||
|
||||
wait(120);
|
||||
|
||||
Obj_Delete(targetenemy);
|
||||
Obj_Delete(targetenemyA);
|
||||
Obj_Delete(targetenemyB);
|
||||
|
||||
}
|
||||
|
||||
// Basic post-death handling after every attack (Solo).
|
||||
|
||||
task _GoToBrazil(targetscene, targetenemy, returnX, returnY, bool isnon, int itemdropamount){
|
||||
|
||||
while(ObjEnemy_GetInfo(targetenemy, INFO_LIFE)>0){
|
||||
yield;
|
||||
}
|
||||
|
||||
DeleteShotAll(TYPE_ALL,TYPE_ITEM);
|
||||
|
||||
SetPlayerInvincibilityFrame(120);
|
||||
|
||||
// ITS COMMON DATA TIME BITCHES
|
||||
|
||||
float[] enemyPos = [ObjMove_GetX(targetenemy), ObjMove_GetY(targetenemy)];
|
||||
SetCommonData("Boss Position", enemyPos);
|
||||
|
||||
alternative(isnon)
|
||||
case(true){_NonspellItemDrop(targetscene, targetenemy, itemdropamount);}
|
||||
others{_NonspellItemDrop(targetscene, targetenemy, itemdropamount);}
|
||||
|
||||
wait(120);
|
||||
|
||||
Obj_Delete(targetenemy);
|
||||
|
||||
}
|
||||
|
||||
task _GoToBrazilMidboss(targetscene, targetenemy, bool isnon, int itemdropamount){
|
||||
|
||||
while(ObjEnemy_GetInfo(targetenemy, INFO_LIFE)>0){
|
||||
yield;
|
||||
}
|
||||
|
||||
DeleteShotAll(TYPE_ALL,TYPE_ITEM);
|
||||
|
||||
SetPlayerInvincibilityFrame(120);
|
||||
|
||||
// ITS COMMON DATA TIME BITCHES
|
||||
|
||||
float[] enemyPos = [ObjMove_GetX(targetenemy), ObjMove_GetY(targetenemy)];
|
||||
SetCommonData("Boss Position", enemyPos);
|
||||
|
||||
alternative(isnon)
|
||||
case(true){_NonspellItemDrop(targetscene, targetenemy, itemdropamount);}
|
||||
others{_NonspellItemDrop(targetscene, targetenemy, itemdropamount);}
|
||||
|
||||
wait(60);
|
||||
|
||||
ObjMove_SetDestAtFrame(targetenemy, enemyPos[0], -150, 45, LERP_SMOOTHER);
|
||||
|
||||
wait(45);
|
||||
|
||||
Obj_Delete(targetenemy);
|
||||
|
||||
}
|
||||
|
||||
// Used after end of last spell for dramatic effect. NOTE TO SELF: REPLACE SOUND & GRAPHICAL EFFECTS
|
||||
|
||||
task _ByeBitch(targetscene, targetenemy){
|
||||
|
||||
while(ObjEnemyBossScene_GetInfo(targetscene, INFO_CURRENT_LIFE) > 0){
|
||||
yield;
|
||||
}
|
||||
|
||||
/*ObjSound_Load(death, defeatsnd);
|
||||
ObjSound_SetVolumeRate(death, 30);
|
||||
ObjSound_SetFade(death, 5);*/
|
||||
|
||||
let x = ObjMove_GetX(targetenemy);
|
||||
let y = ObjMove_GetY(targetenemy);
|
||||
|
||||
StartSlow(TARGET_ALL, 30);
|
||||
SetPlayerInvincibilityFrame(180);
|
||||
DeleteShotAll(TYPE_ALL,TYPE_ITEM);
|
||||
//ObjSound_Play(death);
|
||||
TExplosionA(x,y,10,0.5);
|
||||
wait(120);
|
||||
|
||||
StopSlow(TARGET_ALL);
|
||||
//ObjSound_Play(death);
|
||||
//Obj_Delete(target);
|
||||
TExplosionA(x,y,10,0.5);
|
||||
wait(120);
|
||||
|
||||
}
|
||||
|
||||
function <void> _ByeBitches(int targetscene, int targetboss, int targetenemyA, int targetenemyB, int itemdropamount){
|
||||
|
||||
//wait(120);
|
||||
|
||||
loop{
|
||||
float life = ObjEnemy_GetInfo(targetboss, INFO_LIFE);
|
||||
if(life > 0){yield;}
|
||||
else{break;}
|
||||
}
|
||||
|
||||
int death = ObjSound_Create();
|
||||
ObjSound_Load(death, defeatsnd);
|
||||
ObjSound_SetVolumeRate(death, 40);
|
||||
ObjSound_SetFade(death, 7.5);
|
||||
|
||||
StartSlow(TARGET_ALL, 30);
|
||||
SetPlayerInvincibilityFrame(180);
|
||||
DeleteShotAll(TYPE_ALL,TYPE_ITEM);
|
||||
ObjSound_Play(death);
|
||||
TExplosionA(ObjMove_GetX(targetenemyA), ObjMove_GetY(targetenemyA), 10, 0.5);
|
||||
TExplosionA(ObjMove_GetX(targetenemyB), ObjMove_GetY(targetenemyB), 10, 0.5);
|
||||
wait(120);
|
||||
|
||||
_SpellItemDrop(targetscene, targetenemyA, itemdropamount);
|
||||
_SpellItemDrop(targetscene, targetenemyB, itemdropamount);
|
||||
|
||||
StopSlow(TARGET_ALL);
|
||||
|
||||
ObjSound_Play(death);
|
||||
|
||||
TExplosionA(ObjMove_GetX(targetenemyA), ObjMove_GetY(targetenemyA), 10, 0.5);
|
||||
TExplosionA(ObjMove_GetX(targetenemyB), ObjMove_GetY(targetenemyB), 10, 0.5);
|
||||
|
||||
Obj_Delete(targetboss);
|
||||
Obj_Delete(targetenemyA);
|
||||
Obj_Delete(targetenemyB);
|
||||
|
||||
wait(120);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
//////////////// GRAPHICAL/VISUAL-RELATED TASKS AND FUNCTIONS ////////////////
|
||||
|
||||
*/
|
||||
|
||||
// Handles boss markers during boss fights.
|
||||
|
||||
task _BossMarker(int targetenemy, markertex, int left, int top, int right, int bottom, float scale, float heightoffset){
|
||||
|
||||
int marker = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
ObjPrim_SetTexture(marker, markertex);
|
||||
ObjSprite2D_SetSourceRect(marker, left, top, right, bottom);
|
||||
ObjSprite2D_SetDestCenter(marker);
|
||||
ObjRender_SetScaleXYZ(marker, scale);
|
||||
Obj_SetRenderPriorityI(marker, 19);
|
||||
ObjRender_SetAlpha(marker, 255);
|
||||
//ObjRender_SetY(marker, GetStgFrameHeight()+heightoffset);
|
||||
|
||||
while(!Obj_IsDeleted(targetenemy)){
|
||||
ObjRender_SetPosition(marker, ObjRender_GetX(targetenemy)+(GetScreenWidth()-GetStgFrameWidth())/2, GetStgFrameHeight()+heightoffset+(GetScreenHeight()-GetStgFrameHeight())/2, 1);
|
||||
yield;
|
||||
}
|
||||
|
||||
Obj_Delete(marker);
|
||||
}
|
||||
|
||||
// Tasks that handle calling a spellcard. No spell card history.
|
||||
|
||||
task _DuoCutin(
|
||||
image1, image2,
|
||||
int rectleft, int recttop, int rectright, int rectbottom,
|
||||
int spellID, string spellname,
|
||||
float textsize, float bordersize, int bordercolor, int bonusbordercolor,
|
||||
float textstartx, float textendx, int render1, int render2
|
||||
){
|
||||
|
||||
// Handle the appearance and disappearances of the images
|
||||
|
||||
// 0 = upwards, 1 = downwards || 0 = left, 1 = right
|
||||
|
||||
// Handle the spell text
|
||||
|
||||
int spelltext = ObjText_Create();
|
||||
ObjText_SetText(spelltext, spellname);
|
||||
ObjText_SetFontType(spelltext, "Connecting Chain Handserif");
|
||||
|
||||
ObjText_SetFontSize(spelltext, textsize);
|
||||
ObjText_SetFontColorTop(spelltext, 255, 255, 255);
|
||||
ObjText_SetFontColorBottom(spelltext, 255, 255, 255);
|
||||
ObjText_SetFontBorderType(spelltext, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(spelltext, bordercolor);
|
||||
ObjText_SetFontBorderWidth(spelltext, bordersize);
|
||||
|
||||
ObjText_SetHorizontalAlignment(spelltext, ALIGNMENT_RIGHT);
|
||||
ObjText_SetMaxWidth(spelltext, GetStgFrameWidth);
|
||||
Obj_SetRenderPriorityI(spelltext, 79);
|
||||
ObjRender_SetPosition(spelltext, textstartx, GetStgFrameHeight/8-10, 0); // WIP
|
||||
ObjRender_SetAlpha(spelltext, 255);
|
||||
|
||||
// Handle the spell bonus
|
||||
|
||||
let objBonus = ObjText_Create();
|
||||
ObjText_SetFontSize(objBonus, 38);
|
||||
ObjText_SetFontBold(objBonus, true);
|
||||
ObjText_SetFontType(objBonus, "Anke Calligraph");
|
||||
ObjText_SetFontColorTop(objBonus, 255, 255, 255);
|
||||
ObjText_SetFontColorBottom(objBonus, 255, 255, 255);
|
||||
ObjText_SetFontBorderType(objBonus, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objBonus, bonusbordercolor);
|
||||
ObjText_SetFontBorderWidth(objBonus, 2);
|
||||
|
||||
ObjText_SetHorizontalAlignment(objBonus, ALIGNMENT_RIGHT);
|
||||
ObjText_SetMaxWidth(objBonus, GetStgFrameWidth-24);
|
||||
Obj_SetRenderPriorityI(objBonus, 79);
|
||||
ObjRender_SetPosition(objBonus, textendx, GetStgFrameHeight/8+12, 0); // WIP
|
||||
ObjRender_SetAlpha(objBonus, 255);
|
||||
|
||||
async{
|
||||
while(ObjEnemyBossScene_GetInfo(spellID, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(spellID, INFO_PLAYER_SPELL_COUNT) == 0)
|
||||
{
|
||||
int score = trunc(ObjEnemyBossScene_GetInfo(spellID, INFO_SPELL_SCORE)/10) * 10;
|
||||
score = min(score, 9999999990);
|
||||
let yass = DigitToCommaArray(score);
|
||||
ObjText_SetText(objBonus, yass);
|
||||
yield;
|
||||
}
|
||||
ObjText_SetText(objBonus, ":(");
|
||||
}
|
||||
|
||||
// Actually call the tasks and functions here
|
||||
|
||||
// Mm
|
||||
|
||||
int objCutin1 = _Create2DImage(image1, rectleft, recttop, rectright, rectbottom);
|
||||
int objCutin2 = _Create2DImage(image2, rectleft, recttop, rectright, rectbottom);
|
||||
|
||||
Obj_SetRenderPriorityI(objCutin1, render1);
|
||||
Obj_SetRenderPriorityI(objCutin2, render2);
|
||||
|
||||
_MoveVertical(objCutin1, 0, 0);
|
||||
_MoveVertical(objCutin2, 1, 1);
|
||||
|
||||
//WriteLog(ObjRender_GetY(objCutin1));
|
||||
|
||||
//_MoveIntoPlace(spelltext, textstartx, textendx);
|
||||
_FadeAtPlayer(spelltext);
|
||||
_FadeAtPlayer(objBonus);
|
||||
|
||||
while(ObjEnemyBossScene_GetInfo(spellID, INFO_CURRENT_LIFE) > 0){yield;}
|
||||
|
||||
Obj_Delete(spelltext);
|
||||
Obj_Delete(objBonus);
|
||||
|
||||
//return;
|
||||
|
||||
}
|
||||
|
||||
task _SoloCutin(
|
||||
image,
|
||||
int rectleft, int recttop, int rectright, int rectbottom,
|
||||
int bossID, int spellID, string spellname,
|
||||
float textsize, float bordersize, int bordercolor, int bonusbordercolor,
|
||||
float textstartx, float texty, int render
|
||||
){
|
||||
|
||||
// Handle the spell text
|
||||
|
||||
int spelltext = ObjText_Create();
|
||||
ObjText_SetText(spelltext, spellname);
|
||||
ObjText_SetFontType(spelltext, "Connecting Chain Handserif");
|
||||
|
||||
ObjText_SetFontSize(spelltext, textsize);
|
||||
ObjText_SetFontColorTop(spelltext, 255, 255, 255);
|
||||
ObjText_SetFontColorBottom(spelltext, 255, 255, 255);
|
||||
ObjText_SetFontBorderType(spelltext, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(spelltext, bordercolor);
|
||||
ObjText_SetFontBorderWidth(spelltext, bordersize);
|
||||
|
||||
ObjText_SetHorizontalAlignment(spelltext, ALIGNMENT_LEFT);
|
||||
//ObjText_SetMaxWidth(spelltext, GetStgFrameWidth);
|
||||
Obj_SetRenderPriorityI(spelltext, 79);
|
||||
ObjRender_SetPosition(spelltext, textstartx, texty, 0); // WIP
|
||||
ObjRender_SetAlpha(spelltext, 255);
|
||||
|
||||
// Handle the spell bonus
|
||||
|
||||
let objBonus = ObjText_Create();
|
||||
ObjText_SetFontSize(objBonus, textsize*1.25);
|
||||
ObjText_SetFontBold(objBonus, true);
|
||||
ObjText_SetFontType(objBonus, "Anke Calligraph");
|
||||
ObjText_SetFontColorTop(objBonus, 255, 255, 255);
|
||||
ObjText_SetFontColorBottom(objBonus, 255, 255, 255);
|
||||
ObjText_SetFontBorderType(objBonus, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(objBonus, bonusbordercolor);
|
||||
ObjText_SetFontBorderWidth(objBonus, 2);
|
||||
|
||||
ObjText_SetHorizontalAlignment(objBonus, ALIGNMENT_LEFT);
|
||||
//ObjText_SetMaxWidth(objBonus, GetStgFrameWidth-24);
|
||||
Obj_SetRenderPriorityI(objBonus, 79);
|
||||
ObjRender_SetPosition(objBonus, textstartx, texty+textsize-5, 0); // WIP
|
||||
ObjRender_SetAlpha(objBonus, 255);
|
||||
|
||||
async{
|
||||
while(ObjEnemyBossScene_GetInfo(spellID, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(spellID, INFO_PLAYER_SPELL_COUNT) == 0)
|
||||
{
|
||||
int score = trunc(ObjEnemyBossScene_GetInfo(spellID, INFO_SPELL_SCORE)/10) * 10;
|
||||
score = min(score, 9999999990);
|
||||
let yass = DigitToCommaArray(score);
|
||||
ObjText_SetText(objBonus, "Bonus: " ~ yass);
|
||||
yield;
|
||||
}
|
||||
ObjText_SetText(objBonus, "Bonus Failed...");
|
||||
}
|
||||
|
||||
// Actually call the tasks and functions here
|
||||
|
||||
// Mm
|
||||
|
||||
int objCutin = _Create2DImage(image, rectleft, recttop, rectright, rectbottom);
|
||||
|
||||
Obj_SetRenderPriorityI(objCutin, render);
|
||||
|
||||
_MoveDiagonal(objCutin, GetStgFrameWidth()*1.25, -120, GetStgFrameWidth()/2, GetStgFrameHeight()/2, -120, GetStgFrameHeight()*1.25);
|
||||
//WriteLog(Obj_IsVisible(spelltext));
|
||||
|
||||
//_MoveIntoPlace(spelltext, textstartx, textendx);
|
||||
_FadeAtPlayer(spelltext);
|
||||
_FadeAtPlayer(objBonus);
|
||||
|
||||
while(ObjEnemyBossScene_GetInfo(spellID, INFO_CURRENT_LIFE) > 0){yield;}
|
||||
|
||||
Obj_Delete(spelltext);
|
||||
Obj_Delete(objBonus);
|
||||
|
||||
//return;
|
||||
|
||||
}
|
||||
|
||||
function DigitToCommaArray(num){ //Natashinitai
|
||||
|
||||
let srcStr = IntToString(num);
|
||||
let res = [];
|
||||
let nChar = 0;
|
||||
for(let i = length(srcStr) - 1; i >= 0; i--){
|
||||
res = [srcStr[i]] ~ res;
|
||||
nChar++;
|
||||
if(nChar % 3 == 0 && i > 0) res = "," ~ res;
|
||||
}
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
// Tasks meant to be used with cutin tasks.
|
||||
|
||||
task _MoveVertical(int target, int move, int widthposition){
|
||||
|
||||
float positionstart = [GetStgFrameHeight()*1.5, -GetStgFrameHeight()][move];
|
||||
float positionmid = GetStgFrameHeight()/2;
|
||||
float positionend = [-GetStgFrameHeight()*1.5, GetStgFrameHeight()*1.5][move];
|
||||
|
||||
float positionhort = [3*GetStgFrameWidth/8, 6*GetStgFrameWidth/8][widthposition];
|
||||
|
||||
ObjRender_SetPosition(target, positionhort, positionstart, 0);
|
||||
|
||||
ascent(i in 0..30){
|
||||
ObjRender_SetY(target, Interpolate_Decelerate(positionstart, positionmid, i/30));
|
||||
yield;
|
||||
}
|
||||
|
||||
wait(30);
|
||||
|
||||
ascent(i in 0..30){
|
||||
ObjRender_SetY(target, Interpolate_Accelerate(positionmid, positionend, i/30));
|
||||
yield;
|
||||
}
|
||||
|
||||
Obj_Delete(target);
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
task _MoveDiagonal(int target, int startx, int starty, int midx, int midy, int endx, int endy){
|
||||
|
||||
//"
|
||||
|
||||
ObjRender_SetPosition(target, startx, endx, 1);
|
||||
|
||||
ascent(i in 0..30){
|
||||
ObjRender_SetPosition(target, Interpolate_Decelerate(startx, midx, i/30), Interpolate_Decelerate(starty, midy, i/30), 1);
|
||||
ObjRender_SetAlpha(target, Interpolate_Decelerate(0, 255, i/30));
|
||||
yield;
|
||||
}
|
||||
|
||||
wait(30);
|
||||
|
||||
ascent(i in 0..30){
|
||||
ObjRender_SetPosition(target, Interpolate_Decelerate(midx, endx, i/30), Interpolate_Decelerate(midy, endy, i/30), 1);
|
||||
ObjRender_SetAlpha(target, Interpolate_Decelerate(255, 0, i/30));
|
||||
yield;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
task _MoveIntoPlace(int target, int startx, int endx){
|
||||
ascent(i in 0..30){
|
||||
ObjRender_SetX(target, Interpolate_Decelerate(startx, endx, i/30));
|
||||
ObjRender_SetAlpha(target, Interpolate_Decelerate(0, 255, i/30));
|
||||
yield;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
task _FadeAtPlayer(int target){
|
||||
wait(30);
|
||||
while(!Obj_IsDeleted(target)){
|
||||
int player = GetPlayerObjectID();
|
||||
if(ObjRender_GetY(player) <= GetStgFrameHeight()/3.5){ObjRender_SetAlpha(target, 60);}
|
||||
else{ObjRender_SetAlpha(target, 255);}
|
||||
yield;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Enemy render tasks
|
||||
|
||||
/*
|
||||
These render tasks assume the order of the spritesheet goes like this:
|
||||
|
||||
Idle Idle2 Idle3 ...
|
||||
Left Left2 Left3 ...
|
||||
Right
|
||||
|
||||
*/
|
||||
|
||||
task _RenderEnemyMovement(int obj, int frame, int offsetleft, int offsettop, int width, int height, float flipscale, int frameno, int speed){
|
||||
|
||||
ObjSprite2D_SetSourceRect(obj, offsetleft+width*floor(frame/speed), offsettop, width+width*floor(frame/speed), offsettop+height);
|
||||
ObjRender_SetScaleX(obj, flipscale);
|
||||
|
||||
}
|
||||
|
||||
task _EnemyRenderFull(int enemyobj, int texture, int offsetleft, int offsettop, int width, int height, int framenoidle, int framenomovement, int speed){
|
||||
|
||||
int aniidle = 0;
|
||||
int animove = 0;
|
||||
|
||||
while(!Obj_IsDeleted(enemyobj)){
|
||||
|
||||
float dir = ObjMove_GetAngle(enemyobj);
|
||||
float speed = ObjMove_GetSpeed(enemyobj);
|
||||
|
||||
// Idle
|
||||
if (speed == 0){
|
||||
_RenderEnemyMovement(enemyobj, aniidle, offsetleft, offsettop, width, height, 1, framenoidle, speed);
|
||||
aniidle++;
|
||||
if(aniidle >= speed*framenoidle){aniidle = 0;}
|
||||
}
|
||||
// Left
|
||||
else if (cos(dir) < 0){
|
||||
_RenderEnemyMovement(enemyobj, aniidle, offsetleft, offsettop+height, width, height*2, 1, framenomovement, speed);
|
||||
animove++;
|
||||
if(animove >= speed*framenomovement){animove = 0;}
|
||||
}
|
||||
// Right
|
||||
else if (cos(dir) > 0){
|
||||
_RenderEnemyMovement(enemyobj, aniidle, offsetleft, offsettop+height*2, width, height*3, 1, framenomovement, speed);
|
||||
animove++;
|
||||
if(animove >= speed*framenomovement){animove = 0;}
|
||||
}
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
// Drop a number of point items and petals depending on how fast you kill the enemy and how close you are to them.
|
||||
|
||||
task _EnemyItemDrop(
|
||||
int ID, bool isFlying,
|
||||
int minPoint, int minPIV,
|
||||
int maxPoint, int maxPIV,
|
||||
int maxTimer, int maxDist
|
||||
){
|
||||
|
||||
//wait(spawnTime+5);
|
||||
float enmX = ObjMove_GetX(ID), enmY = ObjMove_GetY(ID);
|
||||
int Bitch = ID;
|
||||
float timer = 1;
|
||||
float dmgCheck = 0;
|
||||
|
||||
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(
|
||||
(-128 < enmX && enmX < STG_WIDTH+128)
|
||||
&&
|
||||
(-128 < enmY && enmY < STG_HEIGHT+128)
|
||||
)
|
||||
|
||||
{
|
||||
|
||||
if (isFlying) {SetCommonData("Flying Defeated", GetCommonData("Flying Defeated", 0)+1);}
|
||||
else {SetCommonData("Ground Defeated", GetCommonData("Ground Defeated", 0)+1);}
|
||||
|
||||
//_ExplosionEffect(enmX, enmY, PetalEffect);
|
||||
//_ScorePopup(float enmX, float enmY, int pointNum, int pivNum);
|
||||
|
||||
// NotifyEvent is faster than NotifyEventAll, considering how the item event will be called many times.
|
||||
|
||||
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]);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,385 @@
|
|||
/* --------------------------------------------------------------------
|
||||
|
||||
/////////////// UNIVERSAL/GENERAL LIBRARY /////////////////
|
||||
|
||||
A library meant for universal functions and including other libraries.
|
||||
|
||||
--------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "script/KevinSystem/kevin_system/Lib_Const.dnh"
|
||||
|
||||
#include "script/KevinSystem/kevin_system/Kevin_ItemLib.txt"
|
||||
#include "script/KevinSystem/kevin_system/Kevin_ItemConst.txt"
|
||||
#include "script/default_system/Default_Effect.txt" // Probably change this somewhere down the line.
|
||||
|
||||
#include "script/KevinSystem/GeneralSoundLib.txt" // Ryannlib momento
|
||||
//#include "script/KevinSystem/TerraShot2x/shot_const.dnh"
|
||||
|
||||
#include "script/KevinSystem/Universal_EnemyLib.dnh"
|
||||
|
||||
#include "script/KevinSystem/KevinShot/shotconst_HD.txt"
|
||||
|
||||
// Convenience constants
|
||||
|
||||
const STG_WIDTH = GetStgFrameWidth();
|
||||
const STG_HEIGHT = GetStgFrameHeight();
|
||||
|
||||
let texEnm = "script/game/resourceLib/EnmTexture.png";
|
||||
let blipVol = GetAreaCommonData("Config", "SEVol", 100) * 0.01;
|
||||
|
||||
InstallFont("script/KevinSystem/font/Connecting Chain Handserif.ttf");
|
||||
InstallFont("script/KevinSystem/font/AnkeCall.ttf");
|
||||
|
||||
// Placeholder
|
||||
|
||||
let invalid = "script/KevinSystem/img/lol.png";
|
||||
|
||||
LoadTextureEx(invalid, true, true);
|
||||
|
||||
let sound = ObjSound_Create();
|
||||
ObjSound_Load(sound, "script/game/resourceLib/dialogueblip.wav");
|
||||
ObjSound_SetVolumeRate(sound, 100 * blipVol);
|
||||
ObjSound_SetSoundDivision(sound, SOUND_SE);
|
||||
|
||||
//_EffectListPreRender(PetalEffect, testEnemyTex, [1536, 0, 1792, 256]);
|
||||
_SoundTask;
|
||||
|
||||
// thanks mugenri uwu
|
||||
|
||||
function <void> TTextScroll(int obj_, string text_) { //Makes text fill gradually in text boxes
|
||||
|
||||
bool dialogEnd = false;
|
||||
bool sentenceEnd = false;
|
||||
string[] tempStrings = SplitString(text_, "/"); //use / for newlines instead of [r]
|
||||
string tempString = "";
|
||||
char lastChar;
|
||||
int waitTime;
|
||||
|
||||
async{
|
||||
while(!dialogEnd){
|
||||
if(sentenceEnd){wait(4); continue;}
|
||||
else{ObjSound_Play(sound); wait(4);}
|
||||
}
|
||||
}
|
||||
|
||||
if (GetVirtualKeyState(VK_OK) == KEY_PUSH) { //Prevents skipping the yield
|
||||
SetVirtualKeyState(VK_OK, KEY_FREE);
|
||||
}
|
||||
|
||||
ascent (i in 0..length(tempStrings)) { //list of substrings
|
||||
ascent (j in 0..length(tempStrings[i])) { //for each character in a substring
|
||||
tempString ~= [tempStrings[i][j]];
|
||||
lastChar = tempString[-1];
|
||||
ObjText_SetText(obj_, tempString);
|
||||
if([tempStrings[i][j]] == "." ||
|
||||
[tempStrings[i][j]] == "," ||
|
||||
[tempStrings[i][j]] == "!" ) {sentenceEnd = true; wait(10);}
|
||||
else {wait(2); sentenceEnd = false;}
|
||||
}
|
||||
tempString ~= ['[','r',']']; //append a newline after each substring
|
||||
}
|
||||
|
||||
dialogEnd = true;
|
||||
wait(30);
|
||||
|
||||
}
|
||||
|
||||
// Simple text object creation (adapted from mkm)
|
||||
|
||||
function CreateTextObject(
|
||||
float mx, my, size,
|
||||
string text, font,
|
||||
int colorTop, colorBottom,
|
||||
int borderColor, borderWidth,
|
||||
int renderPriority
|
||||
){
|
||||
|
||||
let obj = ObjText_Create();
|
||||
ObjText_SetText(obj, text);
|
||||
ObjText_SetFontSize(obj, size);
|
||||
ObjText_SetFontType(obj, font);
|
||||
ObjText_SetFontColorTop(obj, colorTop);
|
||||
ObjText_SetFontColorBottom(obj, colorBottom);
|
||||
ObjText_SetFontBorderType(obj, BORDER_FULL);
|
||||
ObjText_SetFontBorderColor(obj, borderColor);
|
||||
ObjText_SetFontBorderWidth(obj, borderWidth);
|
||||
Obj_SetRenderPriorityI(obj, renderPriority);
|
||||
ObjRender_SetX(obj, mx);
|
||||
ObjRender_SetY(obj, my);
|
||||
return obj;
|
||||
|
||||
}
|
||||
|
||||
// Simple 2D image creation
|
||||
|
||||
function <int> _Create2DImage(imgpath, int rectleft, int recttop, int rectright, int rectbottom){
|
||||
|
||||
int imgname = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
ObjPrim_SetTexture(imgname, imgpath);
|
||||
ObjSprite2D_SetSourceRect(imgname, rectleft, recttop, rectright, rectbottom);
|
||||
ObjSprite2D_SetDestCenter(imgname);
|
||||
//ObjRender_SetPosition(imgname, positionstart)
|
||||
|
||||
return imgname;
|
||||
}
|
||||
|
||||
// Overload that uses arrays instead
|
||||
|
||||
function <int> _Create2DImage(imgpath, int[] rectarray){
|
||||
|
||||
int imgname = ObjPrim_Create(OBJ_SPRITE_2D);
|
||||
ObjPrim_SetTexture(imgname, imgpath);
|
||||
ObjSprite2D_SetSourceRect(imgname, rectarray);
|
||||
ObjSprite2D_SetDestCenter(imgname);
|
||||
//ObjRender_SetPosition(imgname, positionstart)
|
||||
|
||||
return imgname;
|
||||
}
|
||||
|
||||
// Task to make bullet fade after a certain time, bullet loses hitbox while fading
|
||||
|
||||
task _EnemyShotFade(int target, int time, bool fadedelay, float delaymultiplier){
|
||||
ObjShot_SetDeleteFrame(target, time);
|
||||
if (fadedelay){
|
||||
wait(time-time/delaymultiplier);
|
||||
ObjShot_SetIntersectionEnable(target, false);
|
||||
ascent(i in 0..time/delaymultiplier){
|
||||
ObjRender_SetAlpha(target, Interpolate_Smoother(ObjRender_GetAlpha(target), 0, i/(time/delaymultiplier)));
|
||||
yield;
|
||||
}
|
||||
}
|
||||
else{
|
||||
ascent(i in 0..time){
|
||||
ObjRender_SetAlpha(target, Interpolate_Smoother(ObjRender_GetAlpha(target), 0, i/time));
|
||||
yield;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Delay function by Naudiz
|
||||
|
||||
task _Delay(target, del){
|
||||
|
||||
ObjShot_SetDelay(target, del);
|
||||
ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target)); // unless you already have the ID in the function somewhere, in which case you can just use that, or use any other graphic
|
||||
ObjShot_SetDelayMode(target, DELAY_LERP, LERP_ACCELERATE, LERP_DECELERATE); // delay mode, scale lerp, alpha lerp (these are the modes I use in my entry)
|
||||
ObjShot_SetDelayScaleParameter(target, 1, 2, del); // lerps from 2 to 1 scale in del frames (use the value from ObjShot_SetDelay for del)
|
||||
ObjShot_SetDelayAlphaParameter(target, 1, 0, del); // lerps from 0 to 1 (255) alpha in del frames
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Overloads by me
|
||||
|
||||
task _Delay(target, del, orgscale, destscale, orgalpha, destalpha, scalelerp, alphalerp){
|
||||
|
||||
ObjShot_SetDelay(target, del);
|
||||
ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target));
|
||||
ObjShot_SetDelayMode(target, DELAY_LERP, scalelerp, alphalerp);
|
||||
ObjShot_SetDelayScaleParameter(target, destscale, orgscale, del);
|
||||
ObjShot_SetDelayAlphaParameter(target, destalpha, orgalpha, del);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
task _Delay(target, del, orgscale, destscale, orgalpha, destalpha){
|
||||
|
||||
ObjShot_SetDelay(target, del);
|
||||
ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target));
|
||||
ObjShot_SetDelayMode(target, DELAY_LERP, LERP_ACCELERATE, LERP_DECELERATE);
|
||||
ObjShot_SetDelayScaleParameter(target, destscale, orgscale, del);
|
||||
ObjShot_SetDelayAlphaParameter(target, destalpha, orgalpha, del);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
task _Delay(target, del, orgscale, orgalpha){
|
||||
|
||||
ObjShot_SetDelay(target, del);
|
||||
ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target));
|
||||
ObjShot_SetDelayMode(target, DELAY_LERP, LERP_ACCELERATE, LERP_DECELERATE);
|
||||
ObjShot_SetDelayScaleParameter(target, 1, orgscale, del);
|
||||
ObjShot_SetDelayAlphaParameter(target, 1, orgalpha, del);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// Rescales the bullet. Very important.
|
||||
|
||||
task _BulletRescale(target, float scale, bool hitboxscale, hitboxlevel){
|
||||
|
||||
ObjRender_SetScaleXYZ(target, scale, scale, 1);
|
||||
|
||||
if (hitboxscale){
|
||||
ObjShot_SetIntersectionScaleXY(target, scale*hitboxlevel, scale*hitboxlevel);
|
||||
return;
|
||||
}
|
||||
|
||||
else{return;}
|
||||
|
||||
}
|
||||
|
||||
// Item drop functions.
|
||||
|
||||
//////////// TO-DO: Move all item creation to the item script, rendering both of these tasks obsolete. ////////////
|
||||
|
||||
task _NonspellItemDrop(int targetscene, int targetenemy, int itemamount){
|
||||
|
||||
float ex = ObjMove_GetX(targetenemy);
|
||||
float ey = ObjMove_GetY(targetenemy);
|
||||
|
||||
if(ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0){
|
||||
loop(itemamount){
|
||||
CreateScoreItem(POINT_REGULAR, rand(ex-90, ex+90), rand(ey-90, ey+90));
|
||||
}
|
||||
}
|
||||
else{
|
||||
loop(trunc(itemamount/2)){
|
||||
CreateScoreItem(POINT_REGULAR, rand(ex-90, ex+90), rand(ey-90, ey+90));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
task _SpellItemDrop(int targetscene, int targetenemy, int itemamount){
|
||||
|
||||
float ex = ObjMove_GetX(targetenemy);
|
||||
float ey = ObjMove_GetY(targetenemy);
|
||||
|
||||
if(ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SPELL_COUNT) == 0){
|
||||
loop(itemamount){
|
||||
CreateScoreItem(POINT_BHESTIE, rand(ex-90, ex+90), rand(ey-90, ey+90));
|
||||
}
|
||||
}
|
||||
else if (ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SPELL_COUNT) >= 0){
|
||||
loop(trunc(itemamount/2)){
|
||||
CreateScoreItem(POINT_BHESTIE, rand(ex-90, ex+90), rand(ey-90, ey+90));
|
||||
}
|
||||
}
|
||||
else{}
|
||||
|
||||
}
|
||||
|
||||
// By Neck_Logo
|
||||
|
||||
task _CreateCustomTelegraphLine(
|
||||
float posX_, float posY_,
|
||||
float initAngle_, float destAngle_,
|
||||
float initLength_, float destLength_,
|
||||
float initWidth_, float destWidth_,
|
||||
int color_, int maxAlpha_,
|
||||
float growthTime_, float lifeTime_, float fadeTime_
|
||||
) // damn this is some cursed indenting
|
||||
{
|
||||
int scene = GetEnemyBossSceneObjectID();
|
||||
|
||||
let _shotF_Telegraph_Line = ObjParticleList_Create(OBJ_PARTICLE_LIST_2D);
|
||||
ObjPrim_SetTexture(_shotF_Telegraph_Line, invalid);
|
||||
|
||||
Obj_SetRenderPriorityI(_shotF_Telegraph_Line, 39);
|
||||
ObjPrim_SetPrimitiveType(_shotF_Telegraph_Line, PRIMITIVE_TRIANGLELIST);
|
||||
ObjPrim_SetVertexCount(_shotF_Telegraph_Line, 4);
|
||||
|
||||
ObjRender_SetBlendType(_shotF_Telegraph_Line, BLEND_ALPHA);
|
||||
|
||||
//
|
||||
|
||||
float dU = 0.5, dV = 0.5;
|
||||
// Left-top, right-top, left-bottom, right-bottom
|
||||
|
||||
ObjPrim_SetVertexUVT(_shotF_Telegraph_Line, 0, 0, 0);
|
||||
ObjPrim_SetVertexUVT(_shotF_Telegraph_Line, 1, 1, 0);
|
||||
ObjPrim_SetVertexUVT(_shotF_Telegraph_Line, 2, 0, 1);
|
||||
ObjPrim_SetVertexUVT(_shotF_Telegraph_Line, 3, 1, 1);
|
||||
|
||||
// Vertex positions are offset with deltas so that the sprite is centered
|
||||
|
||||
ObjPrim_SetVertexPosition(_shotF_Telegraph_Line, 0, -dU, -dV, 1);
|
||||
ObjPrim_SetVertexPosition(_shotF_Telegraph_Line, 1, dU, -dV, 1);
|
||||
ObjPrim_SetVertexPosition(_shotF_Telegraph_Line, 2, -dU, dV, 1);
|
||||
ObjPrim_SetVertexPosition(_shotF_Telegraph_Line, 3, dU, dV, 1);
|
||||
|
||||
ObjPrim_SetVertexIndex(_shotF_Telegraph_Line, [0, 1, 2, 1, 2, 3]);
|
||||
|
||||
float angle = initAngle_;
|
||||
float span = initLength_;
|
||||
float width = initWidth_;
|
||||
int alpha = 0;
|
||||
|
||||
//_CreateParticleList();
|
||||
_TelegraphLineControl();
|
||||
|
||||
if(scene != ID_INVALID){
|
||||
// growth phase
|
||||
for (int i = 1; i <= growthTime_ && 0 < ObjEnemyBossScene_GetInfo(scene, INFO_ACTIVE_STEP_TOTAL_LIFE); i++) {
|
||||
width = Interpolate_Decelerate(initWidth_, destWidth_, i / growthTime_);
|
||||
alpha = Interpolate_Decelerate(0, maxAlpha_+32, i / growthTime_);
|
||||
RenderTelegraphLine();
|
||||
yield;
|
||||
}
|
||||
|
||||
// static phase
|
||||
for (int j = 1; j <= lifeTime_ && 0 < ObjEnemyBossScene_GetInfo(scene, INFO_ACTIVE_STEP_TOTAL_LIFE); j++) {
|
||||
RenderTelegraphLine();
|
||||
yield;
|
||||
}
|
||||
|
||||
if (!(0 < ObjEnemyBossScene_GetInfo(scene, INFO_ACTIVE_STEP_TOTAL_LIFE))) fadeTime_ = min(fadeTime_, 25);
|
||||
|
||||
}
|
||||
|
||||
else{
|
||||
for (int i = 1; i <= growthTime_ ; i++) {
|
||||
width = Interpolate_Decelerate(initWidth_, destWidth_, i / growthTime_);
|
||||
alpha = Interpolate_Decelerate(0, maxAlpha_+32, i / growthTime_);
|
||||
RenderTelegraphLine();
|
||||
yield;
|
||||
}
|
||||
|
||||
// static phase
|
||||
for (int j = 1; j <= lifeTime_; j++) {
|
||||
RenderTelegraphLine();
|
||||
yield;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
destWidth_ = width;
|
||||
maxAlpha_ = alpha;
|
||||
|
||||
// deletion phase
|
||||
for (int k = 1; k <= fadeTime_; k++) {
|
||||
width = Interpolate_Accelerate(destWidth_, destWidth_ - (destWidth_ - initWidth_) / 2, k / fadeTime_);
|
||||
alpha = Interpolate_Accelerate(maxAlpha_+32, 0, k / fadeTime_);
|
||||
RenderTelegraphLine();
|
||||
yield;
|
||||
}
|
||||
|
||||
Obj_Delete(_shotF_Telegraph_Line);
|
||||
|
||||
task _TelegraphLineControl() {
|
||||
for (int l = 1; l <= growthTime_ + lifeTime_; l++) {
|
||||
angle = Interpolate_Decelerate(initAngle_, destAngle_, l / (growthTime_ + lifeTime_));
|
||||
span = Interpolate_Decelerate(initLength_, destLength_, l / (growthTime_ + lifeTime_));
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
function <void> RenderTelegraphLine() {
|
||||
|
||||
float midX = posX_ + span * cos(angle) + (width / 2) * cos(angle + 90);
|
||||
float midY = posY_ + span * sin(angle) + (width / 2) * sin(angle + 90);
|
||||
|
||||
ObjParticleList_SetPosition(_shotF_Telegraph_Line, midX, midY, 1);
|
||||
ObjParticleList_SetScale(_shotF_Telegraph_Line, span, width, 1);
|
||||
ObjParticleList_SetAngleZ(_shotF_Telegraph_Line, angle);
|
||||
ObjParticleList_SetColor(_shotF_Telegraph_Line, color_);
|
||||
ObjParticleList_SetAlpha(_shotF_Telegraph_Line, alpha);
|
||||
ObjParticleList_AddInstance(_shotF_Telegraph_Line);
|
||||
|
||||
}
|
||||
|
||||
//return _shotF_Telegraph_Line;
|
||||
}
|