Skip to content

Commit

Permalink
Merge pull request #179 from SmashPhil/feature/unstable-testing
Browse files Browse the repository at this point in the history
Version 1.5.7000
  • Loading branch information
SmashPhil authored Aug 3, 2024
2 parents fcb627f + 7e6daa6 commit 8bce0fe
Show file tree
Hide file tree
Showing 111 changed files with 2,610 additions and 1,078 deletions.
Binary file modified 1.5/Assemblies/SmashTools.dll
Binary file not shown.
Binary file modified 1.5/Assemblies/UpdateLogTool.dll
Binary file not shown.
Binary file modified 1.5/Assemblies/Vehicles.dll
Binary file not shown.
2 changes: 2 additions & 0 deletions 1.5/Defs/VehiclesDefs/VehiclePawnBase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@
<needsRest>false</needsRest>
<hasGenders>false</hasGenders>
<foodType>None</foodType>
<alwaysAwake>true</alwaysAwake>
<doesntMove>true</doesntMove> <!-- prevents vanilla from considering it capable of being downed -->
<renderTree>PointlessVehicleRenderTree</renderTree>

<baseBodySize>1.0</baseBodySize>
Expand Down
11 changes: 11 additions & 0 deletions 1.5/Patches/AreaRoad.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>

<Patch>
<Operation Class = "PatchOperationAdd">
<xpath>Defs/DesignationCategoryDef[defName = "Zone"]/specialDesignatorClasses</xpath>
<value>
<li>Vehicles.Designator_AreaRoadExpand</li>
<li>Vehicles.Designator_AreaRoadClear</li>
</value>
</Operation>
</Patch>
31 changes: 31 additions & 0 deletions 1.5/Patches/RaiderFactions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>

<Patch>
<Operation Class = "PatchOperationAddModExtension">
<xpath>Defs/FactionDef[@Name = "PirateBandBase"]</xpath>
<value>
<li Class = "Vehicles.VehicleRaiderDefModExtension"/>
</value>
</Operation>

<Operation Class = "PatchOperationAddModExtension">
<xpath>Defs/FactionDef[@Name = "OutlanderFactionBase"]</xpath>
<value>
<li Class = "Vehicles.VehicleRaiderDefModExtension"/>
</value>
</Operation>

<Operation Class = "PatchOperationAddModExtension">
<xpath>Defs/FactionDef[@Name = "TribeBase"]</xpath>
<value>
<li Class = "Vehicles.VehicleRaiderDefModExtension"/>
</value>
</Operation>

<Operation Class = "PatchOperationAddModExtension">
<xpath>Defs/FactionDef[@Name = "AncientsBase"]</xpath>
<value>
<li Class = "Vehicles.VehicleRaiderDefModExtension"/>
</value>
</Operation>
</Patch>
17 changes: 17 additions & 0 deletions 1.5/Patches/ReduceExplosionsOnWater.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>

<Patch>
<Operation Class = "PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName = "Bullet_Shell_HighExplosive"]</xpath>
<value>
<li Class = "Vehicles.ReduceExplosionOnWater"/>
</value>
</Operation>

<Operation Class = "PatchOperationAddModExtension">
<xpath>Defs/ThingDef[defName = "Bullet_Shell_AntigrainWarhead"]</xpath>
<value>
<li Class = "Vehicles.ReduceExplosionOnWater"/>
</value>
</Operation>
</Patch>
12 changes: 12 additions & 0 deletions 1.5/_Biotech/Patches/BiotechRaiderFactions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>

<Patch>
<!--
<Operation Class = "PatchOperationAddModExtension">
<xpath>Defs/FactionDef[defName = "Sanguophages"]</xpath>
<value>
<li Class = "Vehicles.VehicleRaiderDefModExtension"/>
</value>
</Operation>
-->
</Patch>
9 changes: 9 additions & 0 deletions 1.5/_Royalty/Patches/RoyaltyRaiderFactions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

<Patch>
<Operation Class = "PatchOperationAddModExtension">
<xpath>Defs/FactionDef[defName = "Empire"]</xpath>
<value>
<li Class = "Vehicles.VehicleRaiderDefModExtension"/>
</value>
</Operation>
</Patch>
6 changes: 2 additions & 4 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<name>Vehicle Framework</name>
<author>Smash Phil</author>
<packageId>SmashPhil.VehicleFramework</packageId>
<modVersion>1.5.1659</modVersion>
<modVersion>1.5.1700</modVersion>
<supportedVersions>
<li>1.4</li>
<li>1.5</li>
Expand All @@ -18,7 +18,5 @@
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
</li>
</modDependencies>
<description><![CDATA[<b><color=orange>Vehicle Framework</color></b>
Enables the creation of vehicles in RimWorld.]]></description>
<description><![CDATA[Framework which allows the creation of vehicles in RimWorld.]]></description>
</ModMetaData>
33 changes: 0 additions & 33 deletions AboutTemplate.xml

This file was deleted.

3 changes: 3 additions & 0 deletions Languages/English/Keyed/Enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@
<VF_VehicleTracksNone>None</VF_VehicleTracksNone>
<VF_VehicleTracksVanilla>Vanilla</VF_VehicleTracksVanilla>
<VF_VehicleTracksFull>Full</VF_VehicleTracksFull>

<VF_RoadType_Prioritize>Prioritize</VF_RoadType_Prioritize>
<VF_RoadType_Avoid>Avoid</VF_RoadType_Avoid>
</LanguageData>
9 changes: 8 additions & 1 deletion Languages/English/Keyed/Labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@

<!-- Stats -->
<VF_StatsReport_CargoWeight>Cargo: {0}</VF_StatsReport_CargoWeight>

<VF_StatsReport_Deployed>Deployed</VF_StatsReport_Deployed>

<!-- Designators -->
<VF_RoadZoneExpand>Road area</VF_RoadZoneExpand>
<VF_RoadZoneExpandDesc>Create an area where vehicles will prioritize or avoid moving through.

'Prioritize' areas applied on the edge of the map will designate where vehicle caravans should enter from.</VF_RoadZoneExpandDesc>
<VF_RoadZoneClear>Clear road area</VF_RoadZoneClear>
<VF_RoadZoneClearDesc>Removes road zone. Vehicles will no longer have modified movement over the area.</VF_RoadZoneClearDesc>

<!-- Tooltips -->
<VF_RenameVehicleTooltip>Assign or clear name.</VF_RenameVehicleTooltip>
<VF_RecolorTooltip>Change colors or pattern.</VF_RecolorTooltip>
Expand Down
2 changes: 2 additions & 0 deletions Languages/English/Keyed/Settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Determines whether Vehicles should use values from the mod settings or Defs</VF_

<!-- Combat -->
<VF_CombatSettings>Combat</VF_CombatSettings>
<VF_ShellExplosionsOnWater>Reduce Explosions on Water</VF_ShellExplosionsOnWater>
<VF_ShellExplosionsOnWaterTooltip>Explosive shells over water have their explosion radius reduced and sound effect changed to a splash.</VF_ShellExplosionsOnWaterTooltip>
<VF_RunOverPawns>Run Over Pawns</VF_RunOverPawns>
<VF_RunOverPawnsTooltip>Vehicles can run over pawns and apply blunt damage based on mass and speed.</VF_RunOverPawnsTooltip>
<VF_ChanceToRunOverFriendlies>Friendly Fire Chance</VF_ChanceToRunOverFriendlies>
Expand Down
23 changes: 21 additions & 2 deletions Languages/English/Keyed/SmashTools.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>

<LanguageData>
<ST_AnimationWindow>Animation</ST_AnimationWindow>
<ST_Copy>Copy</ST_Copy>
<ST_Paste>Paste</ST_Paste>

<ST_AnimationWindow>Animator</ST_AnimationWindow>
<ST_ControllerWindow>Controller</ST_ControllerWindow>
<ST_CreateNewClip>Create New Clip...</ST_CreateNewClip>

<ST_RemoveProperties>Remove Properties</ST_RemoveProperties>
<ST_AddKey>Add Key</ST_AddKey>
<ST_RemoveKey>Delete Key</ST_RemoveKey>

<ST_PreviewAnimation>Preview</ST_PreviewAnimation>
<ST_PreviewAnimationTooltip>Enable/disable preview mode of entity's animation in-game</ST_PreviewAnimationTooltip>
<ST_PlayAnimationTooltip>Play the animation</ST_PlayAnimationTooltip>
Expand All @@ -16,7 +24,18 @@
<ST_AddKeyFrame>Add keyframe</ST_AddKeyFrame>
<ST_AddAnimationEvent>Add event</ST_AddAnimationEvent>
<ST_AddProperty>Add Property</ST_AddProperty>

<ST_Injected>Injected</ST_Injected>
<ST_UnsupportedType>UnsupportedType</ST_UnsupportedType>
<ST_NoFunctionSelected>No Function Selected</ST_NoFunctionSelected>

<ST_DopesheetTab>Dopesheet</ST_DopesheetTab>
<ST_CurvesTab>Curves</ST_CurvesTab>

<ST_Layers>Layers</ST_Layers>
<ST_Parameters>Parameters</ST_Parameters>
<ST_CreateState>Create State</ST_CreateState>
<ST_CreateSubState>Create Sub-State Machine</ST_CreateSubState>
<ST_MakeTransition>Make Transition</ST_MakeTransition>
<ST_SetStateDefault>Set as Layer Default State</ST_SetStateDefault>
<ST_CreateBlendTree>Create new BlendTree in State</ST_CreateBlendTree>
</LanguageData>
5 changes: 5 additions & 0 deletions Source/Vehicles/AI/WorkGiver/WorkGiver_RepairVehicle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public class WorkGiver_RepairVehicle : VehicleWorkGiver

public override IEnumerable<Thing> PotentialWorkThingsGlobal(Pawn pawn) => pawn.Map.GetCachedMapComponent<ListerVehiclesRepairable>().RepairsForFaction(pawn.Faction);

public override Danger MaxPathDanger(Pawn pawn)
{
return Danger.Deadly;
}

public override bool CanBeWorkedOn(VehiclePawn vehicle)
{
return vehicle.statHandler.NeedsRepairs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,10 @@ public IEnumerable<GraphicOverlay> Overlays
{
get
{
if (!vehicle.VehicleDef.drawProperties.overlays.NullOrEmpty())
if (!overlays.NullOrEmpty())
{
for (int i = 0; i < overlays.Count; i++)
foreach (GraphicOverlay graphicOverlay in overlays)
{
GraphicOverlay graphicOverlay = overlays[i];
if (graphicOverlay == null)
{
graphicOverlay = vehicle.VehicleDef.drawProperties.overlays[i];
}
yield return graphicOverlay;
}
}
Expand Down
41 changes: 22 additions & 19 deletions Source/Vehicles/Components/Rendering/VehicleRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,50 +34,53 @@ public VehicleRenderer(VehiclePawn vehicle)
[Obsolete("Not currently implemented, still WIP. Do not reference.", error: true)]
public PawnFirefoamDrawer FirefoamOverlays => firefoamOverlays;

public void RenderPawnAt(Vector3 drawLoc, float angle, bool northSouthRotation)
//TODO 1.6 - Rename to RenderVehicleAt
public void RenderPawnAt(Vector3 drawLoc, float extraRotation, bool northSouthRotation)
{
RenderPawnAt(drawLoc, vehicle.FullRotation, extraRotation, northSouthRotation);
}

//TODO 1.6 - Rename to RenderVehicleAt
public void RenderPawnAt(Vector3 drawLoc, Rot8 rot, float extraRotation, bool northSouthRotation)
{
if (!graphics.AllResolved)
{
graphics.ResolveAllGraphics();
}

RenderPawnInternal(drawLoc, angle, northSouthRotation);

if (vehicle.def.race.specialShadowData != null)
{
//if (shadowGraphic == null)
//{
// shadowGraphic = new Graphic_DynamicShadow(vehicle.def.race.specialShadowData);
//}
//shadowGraphic.Draw(drawLoc, Rot4.North, vehicle, 0f);
}
RenderVehicle(drawLoc, rot, extraRotation, northSouthRotation);

//TODO - Draw dynamic shadows

if (graphics.vehicle.VehicleGraphic?.ShadowGraphic != null)
{
graphics.vehicle.VehicleGraphic.ShadowGraphic.Draw(drawLoc, vehicle.FullRotation, vehicle, 0f);
}
if (vehicle.Spawned && !vehicle.Dead)
{
//vehicle.stances.StanceTrackerDraw();
vehicle.vehiclePather.PatherDraw();
}
}

private void RenderPawnInternal(Vector3 rootLoc, float angle, bool northSouthRotation)
private void RenderVehicle(Vector3 rootLoc, Rot8 rot, float extraRotation, bool northSouthRotation)
{
vehicle.UpdateRotationAndAngle();
(Vector3 aboveBodyPos, Rot8 rot) = RenderPawnInternal(rootLoc, angle, vehicle.Rotation, northSouthRotation);
if (vehicle.Spawned)
{
vehicle.UpdateRotationAndAngle();
}
Vector3 aboveBodyPos = RenderVehicleInternal(rootLoc, rot, rot.AsRotationAngle, extraRotation, northSouthRotation);
vehicle.DrawExplosiveWicks(aboveBodyPos, rot);
vehicle.graphicOverlay.RenderGraphicOverlays(aboveBodyPos, angle, rot);
vehicle.graphicOverlay.RenderGraphicOverlays(aboveBodyPos, extraRotation, rot);
}

private (Vector3 aboveBodyPos, Rot8 rot) RenderPawnInternal(Vector3 rootLoc, float angle, Rot4 bodyFacing, bool northSouthRotation)
private Vector3 RenderVehicleInternal(Vector3 rootLoc, Rot4 bodyFacing, float angle, float extraRotation, bool northSouthRotation)
{
if (!graphics.AllResolved)
{
graphics.ResolveAllGraphics();
}

Quaternion quaternion = Quaternion.AngleAxis(angle * (northSouthRotation ? -1 : 1), Vector3.up);
Quaternion quaternion = Quaternion.AngleAxis((angle + extraRotation) * (northSouthRotation ? -1 : 1), Vector3.up);

Vector3 aboveBodyPos = rootLoc + vehicle.VehicleGraphic.DrawOffset(bodyFacing);
aboveBodyPos.y += YOffset_Body;
Expand Down Expand Up @@ -106,7 +109,7 @@ private void RenderPawnInternal(Vector3 rootLoc, float angle, bool northSouthRot
{
Graphics.DrawMesh(mesh, drawLoc, quaternion, graphics.packGraphic.MatAt(bodyFacing, null), 0);
}
return (aboveBodyPos, vehicleRot);
return aboveBodyPos;
}

public void ProcessPostTickVisuals(int ticksPassed)
Expand Down
6 changes: 3 additions & 3 deletions Source/Vehicles/Components/Rendering/Vehicle_DrawTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Verse;
using RimWorld;
using SmashTools;
using SmashTools.Animations;

namespace Vehicles
{
Expand All @@ -15,8 +16,6 @@ public class Vehicle_DrawTracker
public VehicleTrackMaker trackMaker; //reimplement for vehicle specific "footprints"
public Vehicle_RecoilTracker rTracker;



public Vehicle_DrawTracker(VehiclePawn vehicle)
{
this.vehicle = vehicle;
Expand Down Expand Up @@ -56,7 +55,8 @@ public void ProcessPostTickVisuals(int ticksPassed)

public void DrawAt(Vector3 loc)
{
renderer.RenderPawnAt(loc, vehicle.CalculateAngle(out bool northSouthRotation), northSouthRotation);
vehicle.CalculateAngle(out bool northSouthRotation);
renderer.RenderPawnAt(loc, 0, northSouthRotation);
}

public void Notify_Spawned()
Expand Down
Loading

0 comments on commit 8bce0fe

Please sign in to comment.