diff --git a/Projects/Android/AndroidManifest.xml b/Projects/Android/AndroidManifest.xml index a103f00..b6833ae 100644 --- a/Projects/Android/AndroidManifest.xml +++ b/Projects/Android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="47" + android:versionName="0.7.7" android:installLocation="auto" > diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp index 3e6459b..475fe6a 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_players.cpp @@ -8587,11 +8587,6 @@ Ghoul2 Insert End else if ( val > 1.0f ) { val = 1.0f; - CGCam_Shake( 0.1f, 100 ); - } - else - { - CGCam_Shake( val * val * 0.3f, 100 ); } val += Q_flrand(0.0f, 1.0f) * 0.5f; diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp index 4b854de..d1224a2 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp @@ -2364,7 +2364,7 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) { VectorMA( handEnt.origin, -3.0f, forward, handEnt.origin ); - handEnt.renderfx = RF_DEPTHHACK | RF_VRVIEWMODEL; + handEnt.renderfx = RF_DEPTHHACK | RF_VRNOCULLFACE; if (cg.snap->ps.powerups[PW_FORCE_PUSH] > cg.time || (cg.snap->ps.forcePowersActive & (1<handsModel, "tag_weapon"); - gun.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON | RF_VRVIEWMODEL; + gun.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON; //--------- // OK, we are making an assumption here that if we have the phaser that it is always on.... @@ -1454,6 +1454,7 @@ void CG_AddViewWeapon( playerState_t *ps ) scale = 1.75f; } + if ( val < 0.0f ) { val = 0.0f; @@ -1461,11 +1462,6 @@ void CG_AddViewWeapon( playerState_t *ps ) else if ( val > 1.0f ) { val = 1.0f; - CGCam_Shake( 0.1f, 100 ); - } - else - { - CGCam_Shake( val * val * 0.3f, 100 ); } val += Q_flrand(0.0f, 1.0f) * 0.5f; diff --git a/Projects/Android/jni/OpenJK/code/game/g_active.cpp b/Projects/Android/jni/OpenJK/code/game/g_active.cpp index 22c7ff8..1fe0264 100644 --- a/Projects/Android/jni/OpenJK/code/game/g_active.cpp +++ b/Projects/Android/jni/OpenJK/code/game/g_active.cpp @@ -5536,6 +5536,13 @@ extern cvar_t *g_skippingcin; // execute client events ClientEvents( ent, oldEventSequence ); + //Stun Baton is _always_ firing + if (ent->s.weapon == WP_STUN_BATON) + { + //Use alt-fire to indicate not to make a noise, but do inflict damage + FireWeapon(ent, qtrue); + } + if ( pm.useEvent ) { //TODO: Use diff --git a/Projects/Android/jni/OpenJK/code/game/wp_stun_baton.cpp b/Projects/Android/jni/OpenJK/code/game/wp_stun_baton.cpp index 0f06506..9e5ec99 100644 --- a/Projects/Android/jni/OpenJK/code/game/wp_stun_baton.cpp +++ b/Projects/Android/jni/OpenJK/code/game/wp_stun_baton.cpp @@ -27,6 +27,9 @@ along with this program; if not, see . #include "w_local.h" #include "bg_local.h" +std::map damagedEntities; +extern weaponData_t weaponData[WP_NUM_WEAPONS]; + //--------------------------------------------------------- void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire ) { @@ -34,7 +37,14 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire ) trace_t tr; vec3_t mins, maxs, end, start; - G_Sound( ent, G_SoundIndex( "sound/weapons/baton/fire" )); + // If alt_fire is false, then this was triggered by the EV_FIRE_WEAPON event, and we should only make the sound + // and return, if alt_fire is true, then the stun baton is checked every frame in ClientThink_real and shouldn't play + // a sound and should inflict damage + if (!alt_fire) + { + G_Sound(ent, G_SoundIndex("sound/weapons/baton/fire")); + return; + } vec3_t angs, forward; if ( BG_UseVRPosition(ent)) @@ -61,8 +71,27 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire ) return; } + //First clear out any entities that can be damaged again + std::map copyDamagedEntities = damagedEntities; + for (auto &damagedEntity : copyDamagedEntities) + { + if (damagedEntity.second <= level.time) + { + damagedEntities.erase(damagedEntity.first); + } + } + tr_ent = &g_entities[tr.entityNum]; + //Is it too soon to hurt this entity again? + if (damagedEntities.find(tr.entityNum) != damagedEntities.end()) + { + return; + } + + //We are good to inflict damage, store this entity and the next time we can hurt them + damagedEntities[tr.entityNum] = level.time + weaponData[WP_STUN_BATON].fireTime; + if ( tr_ent && tr_ent->takedamage && tr_ent->client ) { G_PlayEffect( "stunBaton/flesh_impact", tr.endpos, tr.plane.normal ); diff --git a/Projects/Android/jni/OpenJK/code/rd-common/tr_types.h b/Projects/Android/jni/OpenJK/code/rd-common/tr_types.h index 630b3a7..9d5b8b8 100644 --- a/Projects/Android/jni/OpenJK/code/rd-common/tr_types.h +++ b/Projects/Android/jni/OpenJK/code/rd-common/tr_types.h @@ -76,7 +76,7 @@ along with this program; if not, see . #define RF_FORCE_ENT_ALPHA 0x800000 // override shader alpha settings -#define RF_VRVIEWMODEL 0x1000000 // specifically drawing a VR hand/weapon model +#define RF_VRNOCULLFACE 0x1000000 // specifically drawing a VR hand so back face culling is disabled // refdef flags #define RDF_NOWORLDMODEL 1 // used for player configuration screen diff --git a/Projects/Android/jni/OpenJK/code/rd-gles/tr_backend.cpp b/Projects/Android/jni/OpenJK/code/rd-gles/tr_backend.cpp index 6cda4cc..f74d31f 100644 --- a/Projects/Android/jni/OpenJK/code/rd-gles/tr_backend.cpp +++ b/Projects/Android/jni/OpenJK/code/rd-gles/tr_backend.cpp @@ -810,7 +810,7 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) { depthRange = qtrue; } - if (backEnd.currentEntity->e.renderfx & RF_VRVIEWMODEL) { + if (backEnd.currentEntity->e.renderfx & RF_VRNOCULLFACE) { isVRViewModel = qtrue; } } else { diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_players.cpp b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_players.cpp index 64c957a..1147f7e 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_players.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_players.cpp @@ -4808,8 +4808,11 @@ Ghoul2 Insert End VectorSubtract(vec3_origin, axis[2], hiltEnt.axis[0]); VectorCopy(axis[1], hiltEnt.axis[1]); VectorCopy(axis[0], hiltEnt.axis[2]); - VectorMA(hiltEnt.origin, 1.0f, hiltEnt.axis[2], hiltEnt.origin); + VectorMA(hiltEnt.origin, 1.2f, hiltEnt.axis[2], hiltEnt.origin); VectorCopy(hiltEnt.origin, hiltEnt.oldorigin); + for (auto & axi : hiltEnt.axis) + VectorScale(axi, 0.7f, axi); + cgi_R_AddRefEntityToScene(&hiltEnt); } @@ -6102,11 +6105,11 @@ Ghoul2 Insert End VectorSubtract(vec3_origin, axis[2], hiltEnt.axis[0]); VectorCopy(axis[1], hiltEnt.axis[1]); VectorCopy(axis[0], hiltEnt.axis[2]); - VectorMA(hiltEnt.origin, 1.0f, hiltEnt.axis[2], hiltEnt.origin); + VectorMA(hiltEnt.origin, 1.2f, hiltEnt.axis[2], hiltEnt.origin); VectorCopy(hiltEnt.origin, hiltEnt.oldorigin); for (auto & axi : hiltEnt.axis) - VectorScale(axi, 0.85f, axi); + VectorScale(axi, 0.7f, axi); cgi_R_AddRefEntityToScene(&hiltEnt); @@ -6153,6 +6156,7 @@ Ghoul2 Insert End scale = 1.75f; } + if ( val < 0.0f ) { val = 0.0f; @@ -6160,11 +6164,6 @@ Ghoul2 Insert End else if ( val > 1.0f ) { val = 1.0f; - CGCam_Shake( 0.1f, 100 ); - } - else - { - CGCam_Shake( val * val * 0.3f, 100 ); } val += Q_flrand(0.0f, 1.0f) * 0.5f; diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_view.cpp b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_view.cpp index 9f43997..9eb0ae0 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_view.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_view.cpp @@ -2052,7 +2052,7 @@ wasForceSpeed=isForceSpeed; VectorMA( handEnt.origin, -3.0f, forward, handEnt.origin ); - handEnt.renderfx = RF_DEPTHHACK | RF_VRVIEWMODEL; + handEnt.renderfx = RF_DEPTHHACK | RF_VRNOCULLFACE; if (cg.snap->ps.powerups[PW_FORCE_PUSH] > cg.time || (cg.snap->ps.forcePowersActive & (1<handsModel, "tag_weapon"); - gun.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON | RF_VRVIEWMODEL; + gun.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON ; //--------- @@ -1343,6 +1343,7 @@ void CG_AddViewWeapon( playerState_t *ps ) scale = 1.75f; } + if ( val < 0.0f ) { val = 0.0f; @@ -1350,11 +1351,6 @@ void CG_AddViewWeapon( playerState_t *ps ) else if ( val > 1.0f ) { val = 1.0f; - CGCam_Shake( 0.1f, 100 ); - } - else - { - CGCam_Shake( val * val * 0.3f, 100 ); } val += Q_flrand(0.0f, 1.0f) * 0.5f; diff --git a/Projects/Android/jni/OpenJK/codeJK2/game/g_active.cpp b/Projects/Android/jni/OpenJK/codeJK2/game/g_active.cpp index 6ff3b18..c2aa96d 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/game/g_active.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/game/g_active.cpp @@ -2931,6 +2931,13 @@ extern cvar_t *g_skippingcin; // execute client events ClientEvents( ent, oldEventSequence ); + //Stun Baton is _always_ firing + if (ent->s.weapon == WP_STUN_BATON) + { + //Use alt-fire to indicate not to make a noise, but do inflict damage + FireWeapon(ent, qtrue); + } + if ( pm.useEvent ) { //TODO: Use diff --git a/Projects/Android/jni/OpenJK/codeJK2/game/wp_stun_baton.cpp b/Projects/Android/jni/OpenJK/codeJK2/game/wp_stun_baton.cpp index 1aa082f..a1dc049 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/game/wp_stun_baton.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/game/wp_stun_baton.cpp @@ -29,6 +29,9 @@ along with this program; if not, see . #include "g_functions.h" #include "bg_local.h" +std::map damagedEntities; +extern weaponData_t weaponData[WP_NUM_WEAPONS]; + //--------------------------------------------------------- void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire ) { @@ -36,7 +39,14 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire ) trace_t tr; vec3_t mins, maxs, end, start; - G_Sound( ent, G_SoundIndex( "sound/weapons/baton/fire" )); + // If alt_fire is false, then this was triggered by the EV_FIRE_WEAPON event, and we should only make the sound + // and return, if alt_fire is true, then the stun baton is checked every frame in ClientThink_real and shouldn't play + // a sound and should inflict damage + if (!alt_fire) + { + G_Sound(ent, G_SoundIndex("sound/weapons/baton/fire")); + return; + } vec3_t angs, forward; if ( BG_UseVRPosition(ent)) @@ -63,8 +73,27 @@ void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire ) return; } + //First clear out any entities that can be damaged again + std::map copyDamagedEntities = damagedEntities; + for (auto &damagedEntity : copyDamagedEntities) + { + if (damagedEntity.second <= level.time) + { + damagedEntities.erase(damagedEntity.first); + } + } + tr_ent = &g_entities[tr.entityNum]; + //Is it too soon to hurt this entity again? + if (damagedEntities.find(tr.entityNum) != damagedEntities.end()) + { + return; + } + + //We are good to inflict damage, store this entity and the next time we can hurt them + damagedEntities[tr.entityNum] = level.time + weaponData[WP_STUN_BATON].fireTime; + if ( tr_ent && tr_ent->takedamage && tr_ent->client ) { G_PlayEffect( "stunBaton/flesh_impact", tr.endpos, tr.plane.normal ); diff --git a/assets/Kyle's_lightsaber_hilt_hd.pk3 b/assets/Kyle's_lightsaber_hilt_hd.pk3 deleted file mode 100644 index 35b83bf..0000000 Binary files a/assets/Kyle's_lightsaber_hilt_hd.pk3 and /dev/null differ diff --git a/assets/packaged_mods_credits.txt b/assets/packaged_mods_credits.txt index 04cedd3..8122959 100644 --- a/assets/packaged_mods_credits.txt +++ b/assets/packaged_mods_credits.txt @@ -1,6 +1,24 @@ The following excellent mods were included in the apk: + +============================================================================================================================= + + +TITLE: Vince Crusty and Elin's VR Fully Modeled Weapons Pack +AUTHORS: Elin and Vince Crusty +FILE NAME: z_Crusty_and_Elin_vr_weapons.pk3 +FILE SIZE: 1.0 MB +DATE RELEASED: 21 MAR 2023 + +DESCRIPTION: This mod replaces all the Jedi Outcast weapons with fully modeled weapons for use in VR + +THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS. + + +============================================================================================================================= + + Author: Grab @@ -20,38 +38,3 @@ Copyright: Grab - - -============================================================================================================================= - - -TITLE: KYLE'S LIGHTSABER HILT HD -AUTHORS: CPT. BROSKI / PUNISHER -FILE NAME: kyle's_lightsaber_hilt_hd.pk3 -FILE SIZE: 1.6 MB -DATE RELEASED: 21 JULY 2021 - -DESCRIPTION: This mod replaces Kyle's original lightsaber with a new model. -The model is based entirely on the in-game model, but it uses better shaders to shine. -INSTALL: Put the hilt_lightsaber_kyle's_hd.pk3 to your Jedi Outcast\GameData\base folder. -UNINSTALL: Remove the hilt_lightsaber_kyle's_hd.pk3 from your Jedi Outcast\GameData\base folder. -BUGS: none - -THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS. - - - - -============================================================================================================================= - - -TITLE: Vince Crusty and Elin's VR Fully Modeled Weapons Pack -AUTHORS: Elin and Vince Crusty -FILE NAME: z_Crusty_and_Elin_vr_weapons.pk3 -FILE SIZE: 1.0 MB -DATE RELEASED: 21 MAR 2023 - -DESCRIPTION: This mod replaces all the Jedi Outcast weapons with fully modeled weapons for use in VR - -THIS MODIFICATION IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY ACTIVISION, RAVEN, OR LUCASARTS ENTERTAINMENT COMPANY LLC. ELEMENTS TM & © LUCASARTS ENTERTAINMENT COMPANY LLC AND/OR ITS LICENSORS. - diff --git a/assets/z_Crusty_and_Elin_vr_weapons.pk3 b/assets/z_Crusty_and_Elin_vr_weapons.pk3 index eaec73f..fa793a7 100644 Binary files a/assets/z_Crusty_and_Elin_vr_weapons.pk3 and b/assets/z_Crusty_and_Elin_vr_weapons.pk3 differ diff --git a/assets/z_Crusty_and_Elin_vr_weapons_JKAcademy.pk3 b/assets/z_Crusty_and_Elin_vr_weapons_JKAcademy.pk3 new file mode 100644 index 0000000..eaec73f Binary files /dev/null and b/assets/z_Crusty_and_Elin_vr_weapons_JKAcademy.pk3 differ diff --git a/java/com/drbeef/jkxr/GLES3JNIActivity.java b/java/com/drbeef/jkxr/GLES3JNIActivity.java index 4098288..99283b6 100644 --- a/java/com/drbeef/jkxr/GLES3JNIActivity.java +++ b/java/com/drbeef/jkxr/GLES3JNIActivity.java @@ -242,16 +242,15 @@ import java.util.Vector; if (!new File("/sdcard/JKXR/JK2/base/no_copy").exists()) { copy_asset("/sdcard/JKXR/JK2/base", "packaged_mods_credits.txt", false); copy_asset("/sdcard/JKXR/JK2/base", "GGDynamicWeapons.pk3", false); - copy_asset("/sdcard/JKXR/JK2/base", "Kyle's_lightsaber_hilt_hd.pk3", false); //Weapon Models - copy_asset("/sdcard/JKXR/JK2/base", "z_Crusty_and_Elin_vr_weapons.pk3", false); + copy_asset("/sdcard/JKXR/JK2/base", "z_Crusty_and_Elin_vr_weapons.pk3", true); } //Bunch of cool mods and their credits - only copy if user wants them if (!new File("/sdcard/JKXR/JK3/base/no_copy").exists()) { //Weapon Models - copy_asset("/sdcard/JKXR/JK3/base", "z_Crusty_and_Elin_vr_weapons.pk3", false); + copy_asset("/sdcard/JKXR/JK3/base", "z_Crusty_and_Elin_vr_weapons_JKAcademy.pk3", true); } //Copy mods to the demo folder if demo assets exist, since the demo doesn't seem to be able to load mods from base @@ -261,15 +260,15 @@ import java.util.Vector; copy_asset("/sdcard/JKXR/JK2/jk2demo", "weapons_vr_jo.cfg", true); //Our assets - copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_vr_assets.pk3", true); + copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_vr_assets_base.pk3", true); + copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_vr_assets_jko.pk3", true); //Bunch of cool mods and their credits - only copy if user wants them copy_asset("/sdcard/JKXR/JK2/jk2demo", "packaged_mods_credits.txt", false); copy_asset("/sdcard/JKXR/JK2/jk2demo", "GGDynamicWeapons.pk3", false); - copy_asset("/sdcard/JKXR/JK2/jk2demo", "Kyle's_lightsaber_hilt_hd.pk3", false); //Weapon Models - copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_Crusty_and_Elin_vr_weapons.pk3", false); + copy_asset("/sdcard/JKXR/JK2/jk2demo", "z_Crusty_and_Elin_vr_weapons.pk3", true); } //Read these from a file and pass through diff --git a/z_vr_assets_base/ui/credits.menu b/z_vr_assets_base/ui/credits.menu index 16ce4ce..5a58d75 100644 --- a/z_vr_assets_base/ui/credits.menu +++ b/z_vr_assets_base/ui/credits.menu @@ -261,7 +261,7 @@ name none type ITEM_TYPE_TEXT rect 0 455 640 40 - text "JKXR: https://www.quakevr.com/jkxr" + text "Join our Patreon: patreon.com/teambeef" font 2 forecolor 1 0 0 1 textscale 1.0