mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
Compare commits
No commits in common. "0e9419b03996921e2a31ade80a6f2845fdcabbb1" and "abb3c1fe18119ea9ae4d1cbf62db5a9811fee402" have entirely different histories.
0e9419b039
...
abb3c1fe18
14 changed files with 5 additions and 235 deletions
Binary file not shown.
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
<Rimworld_Animations.VoiceDef>
|
||||
<defName>Voice_HumanFemale</defName>
|
||||
<race>Human</race>
|
||||
<gender>Female</gender>
|
||||
<sounds>
|
||||
<!-- <li><key>Moan</key><value>FemaleMoanSoundDefHere</value></li> -->
|
||||
</sounds>
|
||||
</Rimworld_Animations.VoiceDef>
|
||||
|
||||
<Rimworld_Animations.VoiceDef>
|
||||
<defName>Voice_HumanMale</defName>
|
||||
<race>Human</race>
|
||||
<gender>Male</gender>
|
||||
<sounds>
|
||||
<!-- <li><key>Moan</key><value>MaleMoanSoundDefHere</value></li> -->
|
||||
</sounds>
|
||||
</Rimworld_Animations.VoiceDef>
|
||||
|
||||
</Defs>
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
<!--
|
||||
<Rimworld_Animations.VoiceDef>
|
||||
<defName>Voice_Orassan</defName>
|
||||
<race>Alien_Orassan</race>
|
||||
<gender>Male</gender>
|
||||
<traitDefs>
|
||||
<li>Wimpy</li>
|
||||
</traitDefs>
|
||||
<sounds>
|
||||
<li><key>Moan</key><value>CatMoans</value></li>
|
||||
</sounds>
|
||||
</Rimworld_Animations.VoiceDef>
|
||||
-->
|
||||
</Defs>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
<Rimworld_Animations.VoiceTagDef>
|
||||
<defName>Moan</defName>
|
||||
</Rimworld_Animations.VoiceTagDef>
|
||||
</Defs>
|
|
@ -22,23 +22,6 @@ namespace Rimworld_Animations
|
|||
return base.OffsetAtTick(tick, parms);
|
||||
}
|
||||
|
||||
public VoiceTagDef voiceAtTick(int tick)
|
||||
{
|
||||
|
||||
Verse.Keyframe keyframe2 = this.part.keyframes[this.part.keyframes.Count - 1];
|
||||
foreach (Verse.Keyframe keyframe in this.part.keyframes)
|
||||
{
|
||||
if (tick == keyframe.tick)
|
||||
{
|
||||
return (keyframe as ExtendedKeyframe).voice;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public SoundDef soundAtTick(int tick)
|
||||
{
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Rimworld_Animations
|
|||
{
|
||||
if (context.AnimationPriority() > priority)
|
||||
{
|
||||
//get highest priority context for fitting animation, and its reorder
|
||||
//get highest priority context for fitting animation
|
||||
priority = context.AnimationPriority();
|
||||
reorder = context.AnimationReorder();
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ namespace Rimworld_Animations
|
|||
public int? variant;
|
||||
public Rot4 rotation = Rot4.North;
|
||||
public SoundDef sound = null;
|
||||
public VoiceTagDef voice = null;
|
||||
public bool visible = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ namespace Rimworld_Animations {
|
|||
|
||||
private List<AnimationDef> animationQueue;
|
||||
private BaseExtendedAnimatorAnchor anchor;
|
||||
private VoiceDef voice;
|
||||
|
||||
|
||||
private int? rotation;
|
||||
private Vector3? offset;
|
||||
private bool isAnimating = false;
|
||||
|
||||
|
||||
public bool IsAnimating
|
||||
{
|
||||
get
|
||||
|
@ -40,8 +40,6 @@ namespace Rimworld_Animations {
|
|||
}
|
||||
}
|
||||
|
||||
private Vector3? offset;
|
||||
|
||||
public Vector3? Offset
|
||||
{
|
||||
get
|
||||
|
@ -54,8 +52,6 @@ namespace Rimworld_Animations {
|
|||
}
|
||||
}
|
||||
|
||||
private int? rotation;
|
||||
|
||||
public int? Rotation
|
||||
{
|
||||
get
|
||||
|
@ -94,15 +90,6 @@ namespace Rimworld_Animations {
|
|||
|
||||
}
|
||||
|
||||
public override void PostSpawnSetup(bool respawningAfterLoad)
|
||||
{
|
||||
if (voice == null)
|
||||
{
|
||||
AssignNewVoice();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Vector3 getAnchor()
|
||||
{
|
||||
return anchor.getDrawPos();
|
||||
|
@ -197,7 +184,6 @@ namespace Rimworld_Animations {
|
|||
Scribe_Values.Look<int>(ref this.animationTicks, "animations_ticks", 0);
|
||||
Scribe_Collections.Look<AnimationDef>(ref animationQueue, "animations_queue");
|
||||
Scribe_Deep.Look<BaseExtendedAnimatorAnchor>(ref this.anchor, "animations_anchor");
|
||||
Scribe_Defs.Look<VoiceDef>(ref this.voice, "animations_voice");
|
||||
|
||||
}
|
||||
|
||||
|
@ -247,29 +233,6 @@ namespace Rimworld_Animations {
|
|||
|
||||
}
|
||||
|
||||
public void AssignNewVoice()
|
||||
{
|
||||
//all voice options
|
||||
List<VoiceDef> voiceOptions =
|
||||
DefDatabase<VoiceDef>.AllDefsListForReading
|
||||
.FindAll(voiceDef => voiceDef.VoiceFitsPawn(pawn));
|
||||
|
||||
//all voice options, with priority (for traitdef specific voices)
|
||||
List<VoiceDef> voiceOptionsWithPriority =
|
||||
voiceOptions.FindAll(voiceDef => voiceDef.takesPriority);
|
||||
|
||||
if (!voiceOptionsWithPriority.NullOrEmpty())
|
||||
{
|
||||
voice = voiceOptionsWithPriority.RandomElementByWeight(x => x.randomChanceFactor);
|
||||
|
||||
}
|
||||
else if (!voiceOptions.NullOrEmpty())
|
||||
{
|
||||
voice = voiceOptions.RandomElementByWeight(x => x.randomChanceFactor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void CheckAndPlaySounds()
|
||||
{
|
||||
|
||||
|
@ -284,32 +247,9 @@ namespace Rimworld_Animations {
|
|||
sound.PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
|
||||
}
|
||||
|
||||
//play voice sounds
|
||||
VoiceTagDef voiceTag = animWorker.voiceAtTick(rootNode.tree.AnimationTick);
|
||||
if (voiceTag != null)
|
||||
{
|
||||
if (voice != null && voice.sounds.ContainsKey(voiceTag))
|
||||
{
|
||||
voice.sounds[voiceTag].PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
|
||||
}
|
||||
|
||||
else if (pawn.RaceProps.Humanlike && RJWAnimationSettings.playHumanlikeVoicesAsDefault)
|
||||
{
|
||||
//play default voice
|
||||
VoiceDef pawnDefaultVoice = (pawn.gender == Gender.Male ? VoiceDefOf.Voice_HumanMale : VoiceDefOf.Voice_HumanFemale);
|
||||
if (pawnDefaultVoice.sounds.ContainsKey(voiceTag))
|
||||
{
|
||||
pawnDefaultVoice.sounds[voiceTag].PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//check rootnodes and children
|
||||
|
||||
if (rootNode?.children != null)
|
||||
{
|
||||
foreach (PawnRenderNode node in rootNode?.children)
|
||||
|
@ -322,25 +262,6 @@ namespace Rimworld_Animations {
|
|||
sound.PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
|
||||
}
|
||||
|
||||
//play voice sounds
|
||||
VoiceTagDef voiceTag = childrenAnimWorker.voiceAtTick(rootNode.tree.AnimationTick);
|
||||
if (voiceTag != null)
|
||||
{
|
||||
if (voice != null && voice.sounds.ContainsKey(voiceTag))
|
||||
{
|
||||
voice.sounds[voiceTag].PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
|
||||
}
|
||||
else if (pawn.RaceProps.Humanlike && RJWAnimationSettings.playHumanlikeVoicesAsDefault)
|
||||
{
|
||||
|
||||
VoiceDef pawnDefaultVoice = (pawn.gender == Gender.Male ? VoiceDefOf.Voice_HumanMale : VoiceDefOf.Voice_HumanFemale);
|
||||
if (pawnDefaultVoice.sounds.ContainsKey(voiceTag))
|
||||
{
|
||||
pawnDefaultVoice.sounds[voiceTag].PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -348,9 +269,6 @@ namespace Rimworld_Animations {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public bool AnimationMakesUseOfProp(AnimationPropDef animationProp)
|
||||
{
|
||||
// never true if not animating; anim props shouldn't be attached
|
||||
|
|
|
@ -14,9 +14,6 @@ namespace Rimworld_Animations {
|
|||
public static bool orgasmQuiver, rapeShiver, soundOverride = true, hearts = true, controlGenitalRotation = false,
|
||||
PlayAnimForNonsexualActs = true;
|
||||
|
||||
//probably move this setting to a different mod menu if moving rjw parts of code
|
||||
public static bool playHumanlikeVoicesAsDefault = true;
|
||||
|
||||
public static bool offsetTab = false, debugMode = false;
|
||||
public static float shiverIntensity = 2f;
|
||||
|
||||
|
@ -24,7 +21,6 @@ namespace Rimworld_Animations {
|
|||
|
||||
base.ExposeData();
|
||||
|
||||
Scribe_Values.Look(ref playHumanlikeVoicesAsDefault, "RJWAnimations-playHumanlikeVoicesAsDefault", true);
|
||||
Scribe_Values.Look(ref debugMode, "RJWAnimations-AnimsDebugMode", false);
|
||||
Scribe_Values.Look(ref offsetTab, "RJWAnimations-EnableOffsetTab", false);
|
||||
Scribe_Values.Look(ref controlGenitalRotation, "RJWAnimations-controlGenitalRotation", false);
|
||||
|
@ -59,7 +55,6 @@ namespace Rimworld_Animations {
|
|||
listingStandard.CheckboxLabeled("RimAnim_HeartsDuringLovin".Translate(), ref RJWAnimationSettings.hearts);
|
||||
listingStandard.CheckboxLabeled("RimAnim_PlayNonsexual".Translate(), ref RJWAnimationSettings.PlayAnimForNonsexualActs);
|
||||
listingStandard.CheckboxLabeled("RimAnim_AnimManagerTab".Translate(), ref RJWAnimationSettings.offsetTab);
|
||||
listingStandard.CheckboxLabeled("RimAnim_HumanlikeVoicesDefault".Translate(), ref RJWAnimationSettings.playHumanlikeVoicesAsDefault);
|
||||
listingStandard.Label("RimAnim_ShiverIntensity".Translate() + RJWAnimationSettings.shiverIntensity);
|
||||
RJWAnimationSettings.shiverIntensity = listingStandard.Slider(RJWAnimationSettings.shiverIntensity, 0.0f, 12f);
|
||||
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
using RimWorld;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace Rimworld_Animations
|
||||
{
|
||||
public class VoiceDef : Def
|
||||
{
|
||||
|
||||
public ThingDef race;
|
||||
public Gender gender = Gender.None;
|
||||
public List<TraitDef> traits = new List<TraitDef>();
|
||||
public bool takesPriority = false;
|
||||
public float randomChanceFactor = 1;
|
||||
|
||||
public Dictionary<VoiceTagDef, SoundDef> sounds = new Dictionary<VoiceTagDef, SoundDef>();
|
||||
|
||||
public bool VoiceFitsPawn(Pawn pawn)
|
||||
{
|
||||
|
||||
//doesn't match race
|
||||
if (pawn.def != race) return false;
|
||||
|
||||
//doesn't match gender
|
||||
if (gender != Gender.None && pawn.gender != gender) return false;
|
||||
|
||||
//if traits list is not empty, and pawn doesn't have any of the designated traits, doesn't match
|
||||
if (!traits.Empty() && !traits.Any(trait => pawn.story.traits.HasTrait(trait))) return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
using RimWorld;
|
||||
using rjw;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Rimworld_Animations
|
||||
{
|
||||
[DefOf]
|
||||
public static class VoiceDefOf
|
||||
{
|
||||
static VoiceDefOf()
|
||||
{
|
||||
DefOfHelper.EnsureInitializedInCtor(typeof(VoiceDefOf));
|
||||
}
|
||||
|
||||
public static VoiceDef Voice_HumanMale;
|
||||
public static VoiceDef Voice_HumanFemale;
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
|
||||
namespace Rimworld_Animations
|
||||
{
|
||||
public class VoiceTagDef : Def
|
||||
{
|
||||
}
|
||||
}
|
|
@ -11,7 +11,6 @@
|
|||
<RimAnim_PlayNonsexual>Play animation for nonsexual acts (handholding, makeout)</RimAnim_PlayNonsexual>
|
||||
<RimAnim_AnimManagerTab>Enable Animation Manager Tab</RimAnim_AnimManagerTab>
|
||||
<RimAnim_ShiverIntensity>Shiver/Quiver Intensity (default 2): </RimAnim_ShiverIntensity>
|
||||
<RimAnim_HumanlikeVoicesDefault>Play humanlike voices by default</RimAnim_HumanlikeVoicesDefault>
|
||||
<RimAnim_DebugMode>Debug Mode</RimAnim_DebugMode>
|
||||
|
||||
<!-- Main Tab Window -->
|
||||
|
@ -20,5 +19,4 @@
|
|||
<RimAnims_CopyToClipboard>Copy Offset to Clipboard</RimAnims_CopyToClipboard>
|
||||
<RimAnims_ShareSettings>Paste offset values in OffsetDef, or share in Discord</RimAnims_ShareSettings>
|
||||
|
||||
|
||||
</LanguageData>
|
|
@ -134,9 +134,6 @@
|
|||
<Compile Include="1.5\Source\RenderSubWorkers\PawnRenderSubWorker_ChangeOffset.cs" />
|
||||
<Compile Include="1.5\Source\Patches\RJWPatches\RJWAnimationSettings.cs" />
|
||||
<Compile Include="1.5\Source\Utilities\AnimationUtility.cs" />
|
||||
<Compile Include="1.5\Source\Voices\VoiceDef.cs" />
|
||||
<Compile Include="1.5\Source\Voices\VoiceDefOf.cs" />
|
||||
<Compile Include="1.5\Source\Voices\VoiceTagDef.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -196,9 +193,6 @@
|
|||
<Content Include="1.5\Defs\TexPathVariantsDefs\TexPathVariants_Xray_Inside.xml" />
|
||||
<Content Include="1.5\Defs\TexPathVariantsDefs\TexPathVariants_XrayPenis_Horse.xml" />
|
||||
<Content Include="1.5\Defs\AnimationDefs\Cowgirl\TexPathVariants_Cowgirl.xml" />
|
||||
<Content Include="1.5\Defs\VoiceDefs\VoiceDef_Human.xml" />
|
||||
<Content Include="1.5\Defs\VoiceDefs\VoiceDef_Orassan.xml" />
|
||||
<Content Include="1.5\Defs\VoiceDefs\VoiceTagDef.xml" />
|
||||
<Content Include="1.5\Patches\AnimationPatchHSK.xml" />
|
||||
<Content Include="1.5\Patches\AnimationPatch_CompExtendedAnimator.xml" />
|
||||
<Content Include="1.5\Patches\AnimationPatch_PawnRenderTree_OffsetSubWorker.xml" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue