Skip to content

Commit

Permalink
v4.0-steam
Browse files Browse the repository at this point in the history
  • Loading branch information
rfuzzo committed Dec 14, 2022
1 parent 408f4c2 commit 107521d
Show file tree
Hide file tree
Showing 190 changed files with 12,058 additions and 1,417 deletions.
3 changes: 2 additions & 1 deletion core/misc.ws
Expand Up @@ -106,6 +106,7 @@ function LogCritical(str : string) {LogChannel('CriticalStates', str);}
function LogCriticalPlayer(str : string) {}
function LogEffects(str : string) {LogChannel('Buffs', str);}
function LogFacts(str : string) {LogChannel('Facts', str);}
function LogGalaxy(str : string) {LogChannel('Galaxy', str);}
function LogHaggle(str : string) {LogChannel('Haggling', str);}
function LogInput(str : string) {LogChannel('Input', str);}
function LogItems(str : string) {LogChannel('Items', str);}
Expand Down Expand Up @@ -150,4 +151,4 @@ function LogDMHits(str : string, optional action : W3DamageAction)
LogChannel('DamageMgrHitsDoT', str);
else
LogChannel('DamageMgrHits', str);
}
}
10 changes: 10 additions & 0 deletions core/resource.ws
Expand Up @@ -20,3 +20,13 @@ import class CResource extends CObject
{
import final function GetPath() : string;
}

import class CGameResource extends CResource
{
import final function GetDefaultCameraTemplate() : CEntityTemplate;
}

import class CCommonGameResource extends CGameResource
{

}
1 change: 1 addition & 0 deletions engine/cameraDirector.ws
Expand Up @@ -28,6 +28,7 @@ import class CCameraDirector
import final function GetFov() : float;

import final function GetTopmostCameraObject() : IScriptable;
import final function GetTopmostCamera() : CCustomCamera;



Expand Down
44 changes: 44 additions & 0 deletions engine/game.ws
Expand Up @@ -58,6 +58,7 @@ import class CGame extends CObject

import final function GetEngineTime() : EngineTime;


import final function GetEngineTimeAsSeconds() : Float;


Expand All @@ -79,6 +80,9 @@ import class CGame extends CObject
import final function LogTimeScales();


import final function GetLocalTimeAsMilliseconds() : int;


import final function GetGameTime() : GameTime;


Expand Down Expand Up @@ -114,6 +118,7 @@ import class CGame extends CObject

import final function OverrideRumbleDuration( lowFreq : float, highFreq : float, newDuration : float );



import final function IsPadConnected() : bool;

Expand Down Expand Up @@ -161,6 +166,9 @@ import class CGame extends CObject


import final function GetFreeCameraPosition() : Vector;


import function MoveFreeCamera(position : Vector, rotation : EulerAngles);


import final function IsShowFlagEnabled( showFlag : EShowFlags ) : bool;
Expand Down Expand Up @@ -211,6 +219,8 @@ import class CGame extends CObject
import final function UnlockAchievement( achName : name ) : bool;

import final function LockAchievement( achName : name ) : bool;

import final function NoticeAchievementProgress( achName : name, countNew : int, optional towards : int ) : bool;

import final function GetUnlockedAchievements( out unlockedAchievments : array< name > );

Expand Down Expand Up @@ -254,6 +264,40 @@ import class CGame extends CObject


import final function SetSingleShotLoadingScreen( contextName : name, optional initString : string, optional videoToPlay : string );

import final function ToggleRTEnabled() : void;

import final function IsIntelGPU() : bool;
import final function GetRTEnabled() : bool;
import final function GetRTSupported() : bool;
import final function GetHairWorksEnabled() : bool;
import final function GetDLSSEnabled() : bool;
import final function GetFSREnabled() : bool;
import final function GetRTAOEnabled() : bool;
import final function GetRTREnabled() : bool;
import final function GetDLSSGEnabled() : bool;
import final function GetDLSSGSupported() : bool;
import final function GetReflexEnabled() : bool;
import final function GetReflexSupported() : bool;

import final function GetGameResource() : CGameResource;

import final function GetPhotomodeEnabled() : bool;
import final function SetPhotomodeEnabled( photomodeEnabled: bool ) : void;

public function GetToggleButtonCaption() : string
{
if (theGame.GetRTEnabled()) {
return GetLocStringByKeyExt("panel_video_performance_mode");
} else {
return GetLocStringByKeyExt("panel_video_quality_mode");
}
}



import final function IsHdrSupported() : bool;
import final function IsRayTracingSupported() : bool;
};


Expand Down
7 changes: 7 additions & 0 deletions engine/sound.ws
Expand Up @@ -527,6 +527,13 @@ import class CScriptSoundSystem extends CObject

LogSound( "Threat rating updated - current value = " + currentThreatRating );
lastThreatDampTime = theGame.GetEngineTimeAsSeconds();


if(!thePlayer.IsCiri() && !thePlayer.IsHoldingItemInLHand() && currentThreatRating >= 95.0)
thePlayer.SetBehaviorVariable('playerDoubleHandSword',1.0f);
else
thePlayer.SetBehaviorVariable('playerDoubleHandSword',0.0f);

}

function IsMonsterFromMonsterHunt( monster : CActor ) : bool
Expand Down
5 changes: 5 additions & 0 deletions engine/telemetryKeyword.ws
Expand Up @@ -25,4 +25,9 @@ import class CR4TelemetryScriptProxy extends CObject

import final function XDPPrintUserStats( statisticName : String );
import final function XDPPrintUserAchievement( achievementName : String );
import final function TelemetryConsentChanged(telemetryConsent : bool);
import final function WasConsentWindowShown() : bool;
import final function MarkShownConsentWindow();

import final function NoticeMenuDepth(d : int);
}
4 changes: 4 additions & 0 deletions engine/world.ws
Expand Up @@ -38,6 +38,8 @@ import class CWorld extends CResource


import final function GetWaterTangent( point : Vector, direction : Vector, optional resolution : float ) : Vector;

import final function ForceUpdateWaterOnPause( force : bool );



Expand Down Expand Up @@ -90,6 +92,8 @@ import class CWorld extends CResource

import final function GetTraceManager() : CScriptBatchQueryAccessor;

import final function GetCameraDirector() : CCameraDirector;


event OnWeatherChange()
{
Expand Down
109 changes: 95 additions & 14 deletions game/actor.ws
Expand Up @@ -78,13 +78,17 @@ import abstract class CActor extends CGameplayEntity
protected var canPlayHitAnim : bool; default canPlayHitAnim = true;


private editable var damageDistanceNotReducing : float; default damageDistanceNotReducing = 5.0f;
private editable var deathDistNotReducing : float; default deathDistNotReducing = 7.0f;
private editable var damageDistanceReducing : float; default damageDistanceReducing = 9.0f;
private editable var deathDistanceReducing : float; default deathDistanceReducing = 9.0f;



private editable var damageDistanceNotReducing : float; default damageDistanceNotReducing = 7.0f;
private editable var deathDistNotReducing : float; default deathDistNotReducing = 9.0f;
private editable var damageDistanceReducing : float; default damageDistanceReducing = 12.0f;
private editable var deathDistanceReducing : float; default deathDistanceReducing = 15.0f;
private editable var fallDamageMinHealthPerc : float; default fallDamageMinHealthPerc = 0.05f;



public var isPlayerFollower : bool;

private var MAC : CMovingPhysicalAgentComponent;
Expand Down Expand Up @@ -726,6 +730,18 @@ import abstract class CActor extends CGameplayEntity
ragdollPullingStartPosition = ragdollPos;
SignalGameplayEvent( 'OnRagdollPullingStart' );
}

public var isInCutsceneIntro : bool;

public function IsInCutsceneIntro() : bool
{
return this.isInCutsceneIntro;
}

public function SetIsInCutsceneIntro( b : bool )
{
this.isInCutsceneIntro = b;
}



Expand Down Expand Up @@ -2380,6 +2396,9 @@ import abstract class CActor extends CGameplayEntity
var wasAlive : bool;
var hudModuleDamageType : EFloatingValueType;


var dontShowDamage : bool;

playerAttacker = (CPlayer)action.attacker;
wasAlive = IsAlive();

Expand All @@ -2402,8 +2421,17 @@ import abstract class CActor extends CGameplayEntity

if(action.processedDmg.vitalityDamage > 0 && UsesVitality())
{
DrainVitality(action.processedDmg.vitalityDamage);
action.SetDealtDamage();

if(this.HasAlternateQuen() && this.HasTag('mq1060_witcher'))
{
dontShowDamage = true;
}
else
{
DrainVitality(action.processedDmg.vitalityDamage);
action.SetDealtDamage();
}

}
if(action.processedDmg.essenceDamage > 0 && UsesEssence())
{
Expand Down Expand Up @@ -2438,7 +2466,9 @@ import abstract class CActor extends CGameplayEntity
hudModuleDamageType = EFVT_None;
}

ShowFloatingValue(hudModuleDamageType, action.GetDamageDealt(), (hudModuleDamageType == EFVT_DoT) );

if(!dontShowDamage)
ShowFloatingValue(hudModuleDamageType, action.GetDamageDealt(), (hudModuleDamageType == EFVT_DoT) );
}


Expand Down Expand Up @@ -2512,7 +2542,7 @@ import abstract class CActor extends CGameplayEntity
}


SignalGameplayEvent('DamageTaken');
SignalGameplayDamageEvent('DamageTaken', action );
}

public function Revive()
Expand Down Expand Up @@ -2721,6 +2751,18 @@ import abstract class CActor extends CGameplayEntity
lastWasHitTime = theGame.GetEngineTimeAsSeconds();
lastWasAttackedTime = lastWasHitTime;


if(damageAction.DealsAnyDamage() && !damageAction.IsDoTDamage())
{
if ( !HasTag( 'NoHitFx' ) )
{
if ( theGame.GetWorld().GetWaterDepth( this.GetWorldPosition() ) > 0 )
{
if ( this.HasEffect( 'water_hit_blood' ) ) this.PlayEffect( 'water_hit_blood' );
}
}
}

return animPlayed;
}

Expand Down Expand Up @@ -3109,12 +3151,21 @@ import abstract class CActor extends CGameplayEntity
event OnBlockingSceneStarted( scene: CStoryScene )
{
this.SetKinematic(true);
SetIsInCutsceneIntro( false );
SetImmortalityMode( AIM_Invulnerable, AIC_Scene );
SetTemporaryAttitudeGroup( 'geralt_friendly', AGP_Scenes);
}

event OnBlockingSceneStarted_OnIntroCutscene( scene: CStoryScene )
{
SetIsInCutsceneIntro( true );
SetImmortalityMode( AIM_Invulnerable, AIC_Scene );
SetTemporaryAttitudeGroup( 'geralt_friendly', AGP_Scenes);
}

event OnBlockingSceneEnded( optional output : CStorySceneOutput)
{
SetIsInCutsceneIntro( false );
SetImmortalityMode( AIM_None, AIC_Scene );
ResetTemporaryAttitudeGroup( AGP_Scenes );
}
Expand Down Expand Up @@ -5215,12 +5266,18 @@ import abstract class CActor extends CGameplayEntity
else
levelDiff = GetLevel() - actor.GetLevel();

if( thePlayer.IsInFistFightMiniGame() || levelDiff < theGame.params.LEVEL_DIFF_DEADLY && (!playerTarget || playerTarget.IsActionAllowed(EIAB_Counter)) )


if( thePlayer.IsInFistFightMiniGame() || levelDiff < 100 && (!playerTarget || playerTarget.IsActionAllowed(EIAB_Counter)) )

countered = actor.PerformCounterCheck(parryInfo);

if(!countered)
{
if( thePlayer.IsInFistFightMiniGame() || levelDiff < theGame.params.LEVEL_DIFF_DEADLY && (!playerTarget || playerTarget.IsActionAllowed(EIAB_Parry)) )


if( thePlayer.IsInFistFightMiniGame() || levelDiff < 100 && (!playerTarget || playerTarget.IsActionAllowed(EIAB_Parry)) )

{
if ( !thePlayer.IsInFistFightMiniGame() && levelDiff >= theGame.params.LEVEL_DIFF_HIGH )
{
Expand Down Expand Up @@ -6353,6 +6410,7 @@ import abstract class CActor extends CGameplayEntity
var damageValue : float;
var deathDistance : float;
var damageDistance : float;
var fallDamageCap : float;

var totalDamage : float;

Expand All @@ -6371,6 +6429,13 @@ import abstract class CActor extends CGameplayEntity
}


if(IsMonster())
{
deathDistance = deathDistanceReducing;
}



if( heightDiff > deathDistance || forcedDeath )
{
dmgPerc = 1.0f;
Expand All @@ -6390,7 +6455,19 @@ import abstract class CActor extends CGameplayEntity

else
{
dmgPerc = MapF( heightDiff, damageDistance, deathDistance, 0.0f, 1.0f );


if ( GetCharacterStats().HasAbilityWithTag('Boss') || (W3MonsterHuntNPC)this )
{
fallDamageCap = 0.23f;
}
else
{
fallDamageCap = 0.85f;
}

dmgPerc = MapF( heightDiff, damageDistance, deathDistance, 0.0f, fallDamageCap );



if( dmgPerc < 1.0f && dmgPerc >= GetHealthPercents() - fallDamageMinHealthPerc )
Expand Down Expand Up @@ -6449,13 +6526,17 @@ import abstract class CActor extends CGameplayEntity
if( momentum < 50.0 || velocity < 3.5 )
return false;

damageVal = 0.25 * momentum;



hitReaction = EHRT_Light;



if( damageVal > 100.0 )
damageVal = 100.0;





damage = new W3DamageAction in this;
damage.Initialize( (CGameplayEntity)( otherBody.GetEntity() ), this, theGame, "physical_object_damage", hitReaction, CPS_Undefined, false, false, false, true );
Expand Down

0 comments on commit 107521d

Please sign in to comment.