Skip to content

Commit

Permalink
Merge branch 'Development' into Verb_LaunchProjectileStaticOneUse
Browse files Browse the repository at this point in the history
  • Loading branch information
N7Huntsman committed Apr 23, 2024
2 parents 047250e + 6a39cc4 commit de1e25a
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 16 deletions.
71 changes: 71 additions & 0 deletions Defs/ResearchProjectDefs/ResearchProjects.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
</prerequisites>
<researchViewX>2</researchViewX>
<researchViewY>4.25</researchViewY>
<generalRules>
<rulesStrings>
<li>subject->gunpowder</li>

<li>subject_story->revolutionized warfare on a medieval world</li>
<li>subject_story->stumbled across explosive powder while conducting alchemical experiments</li>
<li>subject_story->was revered by a tribe for the act of creating thunder</li>

<li>subject_gerund->producing gunpowder</li>
</rulesStrings>
</generalRules>
</ResearchProjectDef>

<ResearchProjectDef>
Expand All @@ -25,6 +36,18 @@
</prerequisites>
<researchViewX>10</researchViewX>
<researchViewY>5.7</researchViewY>
<generalRules>
<rulesStrings>
<li>subject->grenade launchers</li>

<li>subject_story->developed weapons to defeat heavily armored foes</li>
<li>subject_story->toiled in an urbworld munitions factory</li>
<li>subject_story->narrowly survived an assault by mechanoids and vowed to stop such attacks</li>

<li>subject_gerund->crafting grenade launchers</li>
<li>subject_gerund->crafting rocket launchers</li>
</rulesStrings>
</generalRules>
</ResearchProjectDef>

<ResearchProjectDef>
Expand All @@ -43,6 +66,19 @@
</prerequisites>
<researchViewX>14</researchViewX>
<researchViewY>5.7</researchViewY>
<generalRules>
<rulesStrings>
<li>subject->fused explosives</li>
<li>subject->advanced explosives</li>

<li>subject_story->devastated fields with incendiary shells</li>
<li>subject_story->optimized compact thermobaric cell construction</li>
<li>subject_story->explored an enormous blast crater on a toxic world</li>

<li>subject_gerund->crafting advanced launchers</li>
<li>subject_gerund->crafting fuel cell launchers</li>
</rulesStrings>
</generalRules>
</ResearchProjectDef>

<ResearchProjectDef>
Expand All @@ -57,6 +93,19 @@
</prerequisites>
<researchViewX>13</researchViewX>
<researchViewY>5.30</researchViewY>
<generalRules>
<rulesStrings>
<li>subject->advanced ammunition</li>
<li>subject->ammunition fillings</li>

<li>subject_story->stumbled across a cache of advanced weapons</li>
<li>subject_story->learned to use a discarding sabot to defeat powered armor</li>
<li>subject_story->worked for a prolific arms dealer</li>

<li>subject_gerund->creating explosive ammunition</li>
<li>subject_gerund->crafting discarding sabots</li>
</rulesStrings>
</generalRules>
</ResearchProjectDef>

<ResearchProjectDef>
Expand All @@ -70,6 +119,17 @@
</prerequisites>
<researchViewX>7.00</researchViewX>
<researchViewY>5.50</researchViewY>
<generalRules>
<rulesStrings>
<li>subject->night vision</li>

<li>subject_story->worked on developing basic light sensors</li>
<li>subject_story->took part in military field testing on a war-world</li>
<li>subject_story->instructed early midworld soldiers in night combat</li>

<li>subject_gerund->crafting night vision monoculars</li>
</rulesStrings>
</generalRules>
</ResearchProjectDef>

<ResearchProjectDef>
Expand All @@ -86,6 +146,17 @@
</hiddenPrerequisites>
<researchViewX>12.00</researchViewX>
<researchViewY>5.30</researchViewY>
<generalRules>
<rulesStrings>
<li>subject->advanced night vision</li>

<li>subject_story->meticulously studied the sensors of destroyed mechanoids</li>
<li>subject_story->uncovered an ancient cryosleep crypt containing stores of advanced armor</li>
<li>subject_story->was trained as a scout in the military of an urbworld</li>

<li>subject_gerund->crafting night vision sets</li>
</rulesStrings>
</generalRules>
</ResearchProjectDef>

</Defs>
34 changes: 34 additions & 0 deletions Defs/ResearchProjectDefs/ResearchProjects_Turrets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
</prerequisites>
<researchViewX>10</researchViewX>
<researchViewY>4.1</researchViewY>
<generalRules>
<rulesStrings>
<li>subject->heavy-duty barrels</li>
<li>subject->high-caliber emplacements</li>

<li>subject_story->hardened components to withstand enormously high pressures</li>
<li>subject_story->survived a years-long siege on a war-world</li>
<li>subject_story->worked in a factory that manufactured artillery barrels</li>

<li>subject_gerund->building heavy emplacements</li>
</rulesStrings>
</generalRules>
</ResearchProjectDef>

<ResearchProjectDef>
Expand All @@ -31,6 +43,17 @@
</requiredResearchFacilities>
<researchViewX>11</researchViewX>
<researchViewY>3.2</researchViewY>
<generalRules>
<rulesStrings>
<li>subject->heavy autoturrets</li>

<li>subject_story->optimized automated fire-control systems for long range engagements</li>
<li>subject_story->developed improved electronic IFF protocols</li>
<li>subject_story->worked for an urbworld firm that produced mechanoid sensory systems</li>

<li>subject_gerund->automating heavy emplacements</li>
</rulesStrings>
</generalRules>
</ResearchProjectDef>

<ResearchProjectDef>
Expand All @@ -51,6 +74,17 @@
</requiredResearchFacilities>
<researchViewX>15</researchViewX>
<researchViewY>3.2</researchViewY>
<generalRules>
<rulesStrings>
<li>subject->charge turrets</li>

<li>subject_story->created denser power units for higher draw</li>
<li>subject_story->explored the remnants of a toxic world battlefield</li>
<li>subject_story->took part in a doomed assault against a mechanoid stronghold</li>

<li>subject_gerund->building charged-shot turrets</li>
</rulesStrings>
</generalRules>
</ResearchProjectDef>

</Defs>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Patch>
<Defs>
<!-- ==================== Shells ========================== -->

<ThingCategoryDef>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
<products>
<Weapon_RGD-33GNDE>10</Weapon_RGD-33GNDE>
</products>
</RecipeDef>

<RecipeDef ParentName="GrenadeRecipeBase">
<defName>MakeF1GrenadeGNDE</defName>
Expand Down Expand Up @@ -274,4 +275,4 @@
</products>
</RecipeDef>

</Patch>
</Defs>
1 change: 0 additions & 1 deletion ModPatches/Revia Race/Defs/Revia Race/Recipes_Revia.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<?xml version="1.0" encoding="utf-8"?>
<Defs>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Defs>

<!--
While these Defs are only used conditionally with other mods active,
they don't actually do anything by themselves, so there's no harm loading them.
-->
<!-- While these Defs are only used conditionally with other mods active, they don't actually do anything by themselves, so there's no harm loading them. -->

<DamageDef ParentName="Bullet">
<DamageDef ParentName="Frostbite">
<defName>CE_Cryptofuel</defName>
<label>Crypto Burn</label>
<hediff>Frostbite</hediff>
<workerClass>DamageWorker_AddInjury</workerClass>
<additionalHediffs>
<li>
<hediff>Hypothermia</hediff>
<severityPerDamageDealt>0.01</severityPerDamageDealt>
</li>
</additionalHediffs>
<hasForcefulImpact>true</hasForcefulImpact>
<makesBlood>false</makesBlood>
<canInterruptJobs>true</canInterruptJobs>
<externalViolence>true</externalViolence>
<deathMessage>{0} has been frozen to death.</deathMessage>
<armorCategory>Heat</armorCategory>
<minDamageToFragment>15</minDamageToFragment>
<defaultArmorPenetration>0</defaultArmorPenetration>
<defaultArmorPenetration>0.5</defaultArmorPenetration>
<explosionHeatEnergyPerCell>-20</explosionHeatEnergyPerCell>
<soundExplosion>Explosion_Stun</soundExplosion>
<combatLogRules>Damage_Flame</combatLogRules>
<canUseDeflectMetalEffect>false</canUseDeflectMetalEffect>
<explosionColorCenter>(0,1,1,1)</explosionColorCenter>
<explosionColorEdge>(0,0.70,1,1)</explosionColorEdge>
</DamageDef>

</Defs>
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
</projectile>
</ThingDef>

</Patch>
</Defs>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Def>
<Defs>

<!-- == Recipes == -->

Expand Down
13 changes: 11 additions & 2 deletions Source/CombatExtended/CombatExtended/Projectiles/ProjectileCE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1206,9 +1206,18 @@ public override void DrawAt(Vector3 drawLoc, bool flip = false)
}
else
{
Quaternion shadowRotation = ExactRotation;
Quaternion projectileRotation = DrawRotation;
if (def.projectile.spinRate != 0f)
{
float num2 = GenTicks.TicksPerRealSecond / def.projectile.spinRate;
var spinRotation = Quaternion.AngleAxis(Find.TickManager.TicksGame % num2 / num2 * 360f, Vector3.up);
shadowRotation *= spinRotation;
projectileRotation *= spinRotation;
}
//Projectile
//Graphics.DrawMesh(MeshPool.plane10, DrawPos, DrawRotation, def.DrawMatSingle, 0);
Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), DrawPos, DrawRotation, def.DrawMatSingle, 0);
Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), DrawPos, projectileRotation, def.DrawMatSingle, 0);

//Shadow
if (castShadow)
Expand All @@ -1221,7 +1230,7 @@ public override void DrawAt(Vector3 drawLoc, bool flip = false)

//TODO : Vary ShadowMat plane
//Graphics.DrawMesh(MeshPool.plane08, shadowPos, ExactRotation, ShadowMaterial, 0);
Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), shadowPos, ExactRotation, ShadowMaterial, 0);
Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), shadowPos, shadowRotation, ShadowMaterial, 0);
}

Comps_PostDraw();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public override void Tick() //Autoreload code and IsReloading check
if (Active && (this.mannableComp == null || this.mannableComp.MannedNow) && base.Spawned && !(isReloading && WarmingUp))
{
this.GunCompEq.verbTracker.VerbsTick();
if (!this.stunner.Stunned && this.GunCompEq.PrimaryVerb.state != VerbState.Bursting)
if (!IsStunned && this.GunCompEq.PrimaryVerb.state != VerbState.Bursting)
{
if (this.WarmingUp)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ protected bool Retarget()
Thing caster = Caster;


foreach (Pawn possibleTarget in Caster.Position.PawnsNearSegment(lastTargetPos, caster.Map, 3, false))
foreach (Pawn possibleTarget in Caster.Position.PawnsNearSegment(lastTargetPos, caster.Map, 3, false).OfType<Pawn>())
{
if ((possibleTarget.Faction == currentTarget.Pawn?.Faction) && possibleTarget.Faction.HostileTo(caster.Faction) && !possibleTarget.Downed && CanHitFromCellIgnoringRange(Caster.Position, possibleTarget, out IntVec3 dest))
{
Expand Down

0 comments on commit de1e25a

Please sign in to comment.