diff --git a/src/Dodge/Corpse/Make.hs b/src/Dodge/Corpse/Make.hs index bbc071480..c00afbde3 100644 --- a/src/Dodge/Corpse/Make.hs +++ b/src/Dodge/Corpse/Make.hs @@ -17,6 +17,7 @@ makeCorpse :: StdGen -> Creature -> SPic makeCorpse g cr = case cr ^. crType of HoverCrit{} -> noPic $ drawHoverCrit cr ChaseCrit{} -> noPic $ chaseCorpse g cr + CrabCrit{} -> noPic $ crabCorpse g cr _ -> noPic . scaleSH (V3 crsize crsize crsize) @@ -43,8 +44,24 @@ chaseCorpse g cr = mconcat ] where neckq = (V3 6 0 0, Q.qz a) - a = fst $ randomR (-2,2) g - b = fst $ randomR (-2,2) g + (a,g') = randomR (-2,2) g + b = fst $ randomR (-2,2) g' cskin = crShape $ _crType cr -- this should be fixed rotmdir = rotateSH (_crMvDir cr - _crDir cr) headq = neckq `Q.comp` (V3 16 0 0, Q.qz b ) + +crabCorpse :: StdGen -> Creature -> Shape +crabCorpse g cr = mconcat + [ colorSH (_skinUpper cskin) $ overPosSH (Q.apply torsoq) (upperPrismPolyHalfMI 5 $ polyCirc 4 10 + & each . _x *~ 0.6) + , colorSH (_skinUpper cskin) $ overPosSH (Q.apply lclawq) (upperPrismPolyHalfMI 4 $ rectNSWE 20 0 (-2) 2) + <> overPosSH (Q.apply rclawq) (upperPrismPolyHalfMI 4 $ rectNSWE 0 (-20) (-2) 2) + ] + where + torsoq = (V3 0 0 0,Q.qid) + -- not sure which rotation is done first + lclawq = torsoq `Q.comp` (V3 2 8 1, Q.axisAngle (V3 1 0 0) (-0.1) * Q.qz la) + (la,g') = randomR (-2,2) g + ra = fst $ randomR (-2,2) g' + rclawq = torsoq `Q.comp` (V3 2 (-8) 1, Q.axisAngle (V3 1 0 0) (0.1) * Q.qz ra) + cskin = crShape $ _crType cr -- this should be fixed diff --git a/src/Dodge/Creature/Picture.hs b/src/Dodge/Creature/Picture.hs index f01193099..01f2365c2 100644 --- a/src/Dodge/Creature/Picture.hs +++ b/src/Dodge/Creature/Picture.hs @@ -212,6 +212,15 @@ spiderJoint p q = (f $ Q.axisAngle (V3 0 (-1) 0) (pi - (a+b)), f . Q.axisAngle ( c = argV $ (p-q) ^. _xy f x = Q.qz c * x +spiderJoint' :: Point3 -> Float -> Float -> Point3 -> (Q.Quaternion Float, Q.Quaternion Float) +spiderJoint' p l1 l2 q = (f $ Q.axisAngle (V3 0 (-1) 0) (pi - (a+b)), f . Q.axisAngle (V3 0 (-1) 0) $ a - b) +--spiderJoint p q = (Q.qz c, Q.axisAngle (V3 0 (-1) 0) $ a) + where + a = angleThreeSides 10 (distance p q) 10 + b = angleVV3 (q-p) (V3 0 0 (-1)) + c = argV $ (p-q) ^. _xy + f x = Q.qz c * x + deadFeet :: Creature -> Shape {-# INLINE deadFeet #-} deadFeet = feet diff --git a/tags b/tags index d7da914ef..8f58bf109 100644 --- a/tags +++ b/tags @@ -2647,11 +2647,11 @@ arcStepwise src/Geometry.hs 326;" f arcStepwisePositive src/Geometry.hs 340;" f arcTest src/Picture/Test.hs 9;" f arcTest' src/Picture/Test.hs 21;" f -argV src/Geometry/Vector.hs 87;" f +argV src/Geometry/Vector.hs 89;" f armourChaseCrit src/Dodge/Creature/ArmourChase.hs 34;" f armouredChasers src/Dodge/Room/Boss.hs 58;" f armouredCorridor src/Dodge/Room/RoadBlock.hs 20;" f -arms src/Dodge/Creature/Picture.hs 208;" f +arms src/Dodge/Creature/Picture.hs 219;" f arrow src/Picture/Composite.hs 19;" f arrowPath src/Picture/Composite.hs 8;" f assignHotkey src/Dodge/AssignHotkey.hs 9;" f @@ -2703,7 +2703,7 @@ baseItemTriggerType src/Dodge/BaseTriggerType.hs 21;" f baseRifleShape src/Dodge/Item/Draw/SPic.hs 324;" f baseRodShape src/Dodge/Item/Draw/SPic.hs 407;" f baseSMGShape src/Dodge/Item/Draw/SPic.hs 395;" f -baseShoulder src/Dodge/Creature/Picture.hs 246;" f +baseShoulder src/Dodge/Creature/Picture.hs 257;" f baseStickShape src/Dodge/Item/Draw/SPic.hs 301;" f baseStickShapeX src/Dodge/Item/Draw/SPic.hs 293;" f baseStickSpread src/Dodge/HeldUse.hs 346;" f @@ -2825,7 +2825,7 @@ changeSwapWith src/Dodge/Inventory.hs 283;" f charToTuple src/Picture/Base.hs 312;" f charToTupleGrad src/Picture/Text.hs 18;" f chartreuse src/Color.hs 51;" f -chaseCorpse src/Dodge/Corpse/Make.hs 33;" f +chaseCorpse src/Dodge/Corpse/Make.hs 34;" f chaseCrit src/Dodge/Creature/ChaseCrit.hs 30;" f chaseCritInternal src/Dodge/Humanoid.hs 12;" f chaseCritMv src/Dodge/Creature/ReaderUpdate.hs 194;" f @@ -3021,6 +3021,7 @@ crWlPbHit src/Dodge/WorldEvent/ThingsHit.hs 62;" f crWlPbHitZ src/Dodge/WorldEvent/ThingsHit.hs 72;" f crZoneSize src/Dodge/Zoning/Creature.hs 43;" f crabActionUpdate src/Dodge/Creature/ReaderUpdate.hs 124;" f +crabCorpse src/Dodge/Corpse/Make.hs 53;" f crabCrit src/Dodge/Creature/ChaseCrit.hs 37;" f crabCritInternal src/Dodge/Humanoid.hs 29;" f crabFeet src/Dodge/Creature/Picture.hs 172;" f @@ -3122,10 +3123,10 @@ deZoneIX src/Dodge/Zoning/Base.hs 91;" f deZoneWall src/Dodge/Zoning/Wall.hs 69;" f deadEndPSType src/Dodge/Room/Room.hs 264;" f deadEndRoom src/Dodge/Room/Room.hs 267;" f -deadFeet src/Dodge/Creature/Picture.hs 204;" f -deadRot src/Dodge/Creature/Picture.hs 222;" f -deadScalp src/Dodge/Creature/Picture.hs 217;" f -deadUpperBody src/Dodge/Creature/Picture.hs 243;" f +deadFeet src/Dodge/Creature/Picture.hs 215;" f +deadRot src/Dodge/Creature/Picture.hs 233;" f +deadScalp src/Dodge/Creature/Picture.hs 228;" f +deadUpperBody src/Dodge/Creature/Picture.hs 254;" f debrisS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 733;" f debrisSPic src/Dodge/Prop/Draw.hs 17;" f debrisSize src/Dodge/Block/Debris.hs 131;" f @@ -3203,7 +3204,7 @@ defaultVision src/Dodge/Default/Creature.hs 86;" f defaultWall src/Dodge/Default/Wall.hs 15;" f defaultWindow src/Dodge/Default/Wall.hs 54;" f defaultWorld src/Dodge/Default/World.hs 34;" f -degToRad src/Geometry/Vector.hs 124;" f +degToRad src/Geometry/Vector.hs 126;" f deleteIMInZone src/Dodge/Base.hs 70;" f deleteWallFromZones src/Dodge/Wall/Zone.hs 23;" f deleteWallID src/Dodge/Wall/Delete.hs 13;" f @@ -3222,7 +3223,7 @@ destroyMcType src/Dodge/Machine/Destroy.hs 27;" f destroyMount src/Dodge/Wall/Damage.hs 167;" f destroyMounts src/Dodge/Wall/Damage.hs 164;" f destroyProjectile src/Dodge/Projectile/Update.hs 112;" f -detV src/Geometry/Vector.hs 100;" f +detV src/Geometry/Vector.hs 102;" f detector src/Dodge/Item/Held/Utility.hs 27;" f detectorColor src/Dodge/Item/Draw/SPic.hs 435;" f detectorInfo src/Dodge/Item/Info.hs 224;" f @@ -3243,7 +3244,7 @@ displayFreeSlots src/Dodge/DisplayInventory.hs 196;" f displayIndents src/Dodge/DisplayInventory.hs 110;" f displayPulse src/Dodge/Inventory/SelectionList.hs 176;" f displayTerminalLineString src/Dodge/Update.hs 582;" f -dist src/Geometry/Vector.hs 191;" f +dist src/Geometry/Vector.hs 193;" f dist3 src/Geometry/Vector3D.hs 102;" f distributeAmmoToItem src/Dodge/WorldEffect.hs 150;" f distributeAmmoToYou src/Dodge/WorldEffect.hs 138;" f @@ -3329,7 +3330,7 @@ doorBetween src/Dodge/Placement/Instance/Door.hs 34;" f doorCor src/Dodge/Room/Room.hs 406;" f doorLerp src/Dodge/Door.hs 43;" f doorLerpWithTimer src/Dodge/Door.hs 76;" f -dotV src/Geometry/Vector.hs 82;" f +dotV src/Geometry/Vector.hs 84;" f dotV3 src/Geometry/Vector3D.hs 120;" f doubleCorridorBarrels src/Dodge/Room/Room.hs 297;" f doublePair src/Geometry.hs 162;" f @@ -3378,7 +3379,7 @@ drawDragSelecting src/Dodge/Render/HUD.hs 162;" f drawDumbSwitch src/Dodge/Button/Draw.hs 31;" f drawEmptySet src/Dodge/Render/Picture.hs 153;" f drawEnergyBall src/Dodge/EnergyBall/Draw.hs 7;" f -drawEquipment src/Dodge/Creature/Picture.hs 255;" f +drawEquipment src/Dodge/Creature/Picture.hs 266;" f drawExamineInventory src/Dodge/Render/HUD.hs 199;" f drawExplosiveBall src/Dodge/EnergyBall/Draw.hs 15;" f drawFarWallDetect src/Dodge/Debug/Picture.hs 271;" f @@ -4124,7 +4125,7 @@ machinePistol src/Dodge/Item/Held/Stick.hs 24;" f magAmmoParams src/Dodge/HeldUse.hs 957;" f magAmmoType src/Dodge/Item/MagAmmoType.hs 9;" f magShield src/Dodge/Item/Equipment.hs 26;" f -magV src/Geometry/Vector.hs 178;" f +magV src/Geometry/Vector.hs 180;" f magV3 src/Geometry/Vector3D.hs 79;" f magazineCombinations src/Dodge/Combine/Combinations.hs 43;" f magenta src/Color.hs 46;" f @@ -4343,7 +4344,7 @@ nearParallel src/Dodge/LevelGen/StaticWalls/Deprecated.hs 14;" f nearPoint src/Dodge/Zoning/Common.hs 8;" f nearRect src/Dodge/Zoning/Common.hs 16;" f nearSeg src/Dodge/Zoning/Common.hs 12;" f -nearZeroAngle src/Geometry/Vector.hs 144;" f +nearZeroAngle src/Geometry/Vector.hs 146;" f nearestAngleRep src/Geometry.hs 148;" f newExtraAwareness src/Dodge/Creature/Perception.hs 147;" f newKey src/IntMapHelp.hs 61;" f @@ -4362,7 +4363,7 @@ nonConvexChasm src/Dodge/Room/Tutorial.hs 269;" f nonCornerLinks src/Dodge/Room/SensorDoor.hs 53;" f normalGait src/Dodge/Creature/State/WalkCycle.hs 141;" f normalTo8 src/Shader/Poke.hs 466;" f -normalizeAngle src/Geometry/Vector.hs 134;" f +normalizeAngle src/Geometry/Vector.hs 136;" f normalizeAnglePi src/Dodge/Base.hs 154;" f normalizeColor src/Color.hs 103;" f normalizeV src/Geometry/Vector.hs 44;" f @@ -4589,7 +4590,7 @@ printPoint src/Dodge/Debug/Picture.hs 35;" f printRotPoint src/Dodge/Debug/Picture.hs 38;" f prismBox src/Shape.hs 74;" f prismPoly src/Shape.hs 60;" f -projV src/Geometry/Vector.hs 183;" f +projV src/Geometry/Vector.hs 185;" f propSPic src/Dodge/Prop/Draw.hs 27;" f propagateOrientation src/Dodge/Item/Orientation.hs 92;" f ps0 src/Dodge/LevelGen/PlacementHelper.hs 52;" f @@ -4654,7 +4655,7 @@ qz src/Quaternion.hs 81;" f rLauncher src/Dodge/Item/Held/Launcher.hs 14;" f rLauncherX src/Dodge/Item/Held/Launcher.hs 30;" f rToOnward src/Dodge/Cleat.hs 21;" f -radToDeg src/Geometry/Vector.hs 129;" f +radToDeg src/Geometry/Vector.hs 131;" f radiusSpring src/Dodge/Update.hs 973;" f randBlockBreakWeapon src/Dodge/Item/Random.hs 7;" f randC1 src/Dodge/Placement/Instance/Creature.hs 8;" f @@ -4714,7 +4715,7 @@ reflVelWallDamp src/Dodge/Base/Wall.hs 20;" f reflWall src/Dodge/Base/Wall.hs 16;" f reflectAngle src/Geometry.hs 142;" f reflectIn src/Geometry.hs 136;" f -reflectInNormal src/Geometry/Vector.hs 223;" f +reflectInNormal src/Geometry/Vector.hs 225;" f reflectInParam src/Geometry.hs 230;" f reflectLaserAlong src/Dodge/Item/Weapon/LaserPath.hs 20;" f reflectPulseLaserAlong src/Dodge/Item/Weapon/LaserPath.hs 65;" f @@ -4829,8 +4830,8 @@ rotateTo src/Polyhedra/Geodesic.hs 65;" f rotateTo8 src/Dodge/Update/Camera/Rotate.hs 6;" f rotateToOverlappingWall src/Dodge/Update/Camera.hs 219;" f rotateToZ src/Quaternion.hs 38;" f -rotateV src/Geometry/Vector.hs 112;" f -rotateVAround src/Geometry/Vector.hs 119;" f +rotateV src/Geometry/Vector.hs 114;" f +rotateVAround src/Geometry/Vector.hs 121;" f rotateXY src/Polyhedra.hs 28;" f roundPoint2 src/Geometry/Intersect.hs 235;" f roundTank src/Dodge/Placement/Instance/Tank.hs 26;" f @@ -4845,15 +4846,15 @@ rsObjectColor src/Dodge/RadarSweep/Draw.hs 34;" f runPastStart src/Dodge/Room/Start.hs 73;" f runStateWorld src/Dodge/Randify.hs 18;" f sPS src/Dodge/LevelGen/PlacementHelper.hs 27;" f -safeAngleVV src/Geometry/Vector.hs 75;" f -safeArgV src/Geometry/Vector.hs 94;" f +safeAngleVV src/Geometry/Vector.hs 77;" f +safeArgV src/Geometry/Vector.hs 96;" f safeHead src/ListHelp.hs 68;" f safeMinMaybeL src/FoldableHelp.hs 48;" f safeMinimumOn src/FoldableHelp.hs 26;" f safeMinimumOnMaybe src/FoldableHelp.hs 67;" f safeMinimumOnMaybeF src/FoldableHelp.hs 39;" f safeMinimumOnMaybeL src/FoldableHelp.hs 57;" f -safeNormalizeV src/Geometry/Vector.hs 171;" f +safeNormalizeV src/Geometry/Vector.hs 173;" f safeSwapKeys src/IntMapHelp.hs 78;" f safeUncons src/ListHelp.hs 73;" f safeUpdateSingleNode src/TreeHelp.hs 118;" f @@ -4869,7 +4870,7 @@ scale3 src/Picture/Base.hs 137;" f scaleMat src/MatrixHelper.hs 71;" f scaleMatrix src/MatrixHelper.hs 68;" f scaleSH src/Shape.hs 266;" f -scalp src/Dodge/Creature/Picture.hs 231;" f +scalp src/Dodge/Creature/Picture.hs 242;" f scancodeToHotkey src/Dodge/Creature/YourControl.hs 82;" f scodeToChar src/Dodge/ScodeToChar.hs 6;" f scorchSPic src/Dodge/Creature/Update.hs 164;" f @@ -5122,7 +5123,7 @@ spawnAt src/Dodge/SpawnAt.hs 14;" f spawnerCrit src/Dodge/Creature.hs 54;" f spawnerRoom src/Dodge/Room/Room.hs 390;" f speedLegs src/Dodge/Item/Equipment.hs 74;" f -spiderJoint src/Dodge/Creature/Picture.hs 195;" f +spiderJoint src/Dodge/Creature/Picture.hs 206;" f splashMenu src/Dodge/Menu.hs 31;" f splashMenuOptions src/Dodge/Menu.hs 36;" f splashScreen src/Dodge/Initialisation.hs 10;" f @@ -5143,7 +5144,7 @@ sqSpitChasm src/Dodge/Room/Tutorial.hs 248;" f square src/Geometry/Polygon.hs 56;" f squareDecoration src/Dodge/Placement/TopDecoration.hs 48;" f squashIntersectCirclePoint src/Dodge/WallCreatureCollisions.hs 129;" f -squashNormalizeV src/Geometry/Vector.hs 164;" f +squashNormalizeV src/Geometry/Vector.hs 166;" f ssLookupDown src/Dodge/SelectionSections.hs 96;" f ssLookupGE' src/Dodge/SelectionSections.hs 150;" f ssLookupGT src/Dodge/SelectionSections.hs 137;" f @@ -5345,7 +5346,7 @@ topTestPart src/Dodge/TestString.hs 96;" f torchShape src/Dodge/Item/Draw/SPic.hs 277;" f torqueAmount src/Dodge/HeldUse.hs 606;" f torqueCr src/Dodge/WorldEffect.hs 85;" f -torso src/Dodge/Creature/Picture.hs 236;" f +torso src/Dodge/Creature/Picture.hs 247;" f tractCr src/Dodge/TractorBeam/Update.hs 28;" f tractFlIt src/Dodge/TractorBeam/Update.hs 23;" f tractorBeamAt src/Dodge/HeldUse.hs 850;" f @@ -5420,7 +5421,7 @@ tutLight src/Dodge/Room/Tutorial.hs 401;" f tutRezBox src/Dodge/Room/Tutorial.hs 610;" f tutRoomTree src/Dodge/Floor.hs 20;" f tutorialMessage1 src/Dodge/Room/Tutorial.hs 635;" f -tweenAngles src/Geometry/Vector.hs 196;" f +tweenAngles src/Geometry/Vector.hs 198;" f twinSlowDoorChasers src/Dodge/Room/LongDoor.hs 83;" f twinSlowDoorRoom src/Dodge/Room/LongDoor.hs 39;" f twists src/Dodge/Creature/Test.hs 101;" f @@ -5438,7 +5439,7 @@ uncurryV src/Geometry/Data.hs 66;" f underBarrelSlot src/Dodge/Item/Scope.hs 176;" f unfoldrMID src/MonadHelp.hs 33;" f unigate src/Dodge/Item/Scope.hs 108;" f -unitVectorAtAngle src/Geometry/Vector.hs 107;" f +unitVectorAtAngle src/Geometry/Vector.hs 109;" f unlockInv src/Dodge/Inventory/Lock.hs 12;" f unpause src/Dodge/Menu.hs 205;" f unsafeBlinkAction src/Dodge/Creature/Action/Blink.hs 59;" f @@ -5578,7 +5579,7 @@ updateWheelEvent src/Dodge/Update/Scroll.hs 21;" f updateWheelEvents src/Dodge/Update.hs 492;" f updateWorldEventFlag src/Dodge/Update.hs 129;" f updateWorldEventFlags src/Dodge/Update.hs 117;" f -upperBody src/Dodge/Creature/Picture.hs 251;" f +upperBody src/Dodge/Creature/Picture.hs 262;" f upperBox src/Shape.hs 153;" f upperBoxHalf src/Shape.hs 219;" f upperBoxMT src/Shape.hs 144;" f @@ -5617,8 +5618,8 @@ usedRoomInLinkPoss src/Dodge/PlacementSpot.hs 209;" f usedRoomLinkPoss src/Dodge/PlacementSpot.hs 216;" f v2z src/Geometry/Vector3D.hs 94;" f vCen3 src/Geometry/Vector3D.hs 116;" f -vInverse src/Geometry/Vector.hs 160;" f -vNormal src/Geometry/Vector.hs 155;" f +vInverse src/Geometry/Vector.hs 162;" f +vNormal src/Geometry/Vector.hs 157;" f vNormaly src/Geometry/Vector3D.hs 73;" f vShape src/Dodge/Placement/Instance/LightSource.hs 100;" f vToL src/MatrixHelper.hs 56;" f @@ -5730,11 +5731,11 @@ xCylinder src/Shape.hs 133;" f xCylinderST src/Shape.hs 130;" f xIntercepts src/Dodge/Zoning/Base.hs 66;" f xSwitch src/Dodge/Room/Airlock.hs 32;" f -xV2 src/Geometry/Vector.hs 207;" f -xyV3 src/Geometry/Vector.hs 219;" f -xyzV4 src/Geometry/Vector.hs 215;" f +xV2 src/Geometry/Vector.hs 209;" f +xyV3 src/Geometry/Vector.hs 221;" f +xyzV4 src/Geometry/Vector.hs 217;" f yIntercepts src/Dodge/Zoning/Base.hs 78;" f -yV2 src/Geometry/Vector.hs 211;" f +yV2 src/Geometry/Vector.hs 213;" f yellow src/Color.hs 44;" f you src/Dodge/Base/You.hs 17;" f youDropItem src/Dodge/Creature/Action.hs 191;" f