1
1

5 Коммитууд 05523e1ede ... 07efc2ede8

Эзэн SHA1 Мессеж Огноо
  Reddo 07efc2ede8 Correctly say the stance needed for the action. 5 жил өмнө
  Reddo b8a44b275b Utilize stances in combat. 5 жил өмнө
  Reddo f25698c2f7 Crouching message 5 жил өмнө
  Reddo eefde051c2 Awkward 5 жил өмнө
  Reddo 7953ddeff2 ??? 5 жил өмнө

+ 6 - 0
app/Elements/Modules/AppearanceHandler.ts

@@ -102,6 +102,12 @@ module Elements.AppearanceHandler {
         // TODO: Check if has a specific look to it. Optional. Hard to do.
         // Examples: "You are dressed casually like a woman.", "You are wearing formal women's clothing." etc.
 
+
+        // Current Stance
+        if (player.stance == PersonStance.ALLFOURS) {
+            presentation.add(Say.PARAGRAPH_BREAK, "You are currently crouching.");
+        }
+
         await print(presentation);
     }
 }

+ 2 - 2
app/World/Classes/Action.ts

@@ -155,10 +155,10 @@ Action.check.addRule(
             if (actor instanceof Person) {
                 if (action.allowedStances.indexOf(actor.stance) == -1) {
                     if (action.actor == WorldState.player) {
-                        action.say = new Say("You can't do that while ", PersonStanceNames[actor.stance], ", you need to be ", PersonStanceNames[actor.stance], ".");
+                        action.say = new Say("You can't do that while ", PersonStanceNames[actor.stance], ", you need to be ", PersonStanceNames[action.allowedStances[0]], ".");
                     }
-                    return false;
                     action.stop();
+                    return false;
                 }
             }
         }

+ 53 - 38
app/World/Classes/Action/ActionAttack.ts

@@ -95,60 +95,75 @@ class ActionAttack extends Action {
         }
     });
 
+    // TODO: Reduce these god functions into smaller functions that are easier to modify by future changes.
     public static checkAccuracyRule = ActionAttack.check.createAndAddRule({
         name : "Attack - Is it a hit?",
         code : async (runner : RulebookRunner<ActionAttack>) => {
             let action = runner.noun;
             let actorDex = (<Person> runner.noun.actor).getStat(Attributes.Agility);
+            let actor = (<Person> runner.noun.actor);
+            if (actor.stance == PersonStance.ALLFOURS) {
+                actorDex = Math.floor(actorDex/2);
+            }
+
             let targetDex = 0;
             let target = runner.noun.getTarget();
             if (target instanceof Person) {
                 targetDex = target.getStat(Attributes.Agility);
-            }
+                if (target.stance == PersonStance.ALLFOURS) {
+                    targetDex = Math.floor(targetDex/2);
+                } else if (target.stance == PersonStance.KNOCKEDOUT) {
+                    targetDex = 0;
+                }
 
 
-            let reaction = ActionAttackReaction.DODGE;
-            if (target == WorldState.player) {
-                Elements.CurrentTurnHandler.printAsContent(new Say(action.actor, " ", ActionAttack.gettingAttacked.getOne()));
-                let choices = ["Counter-Attack", "Dodge", "Resist"];
-                let choice = await Controls.giveChoices(false, ...choices);
-                if (choice[1] == 0) {
-                    reaction = ActionAttackReaction.COUNTERATTACK;
-                } else if (choice[1] == 2) {
-                    reaction = ActionAttackReaction.DODGE;
-                } else {
+                let reaction = ActionAttackReaction.DODGE;
+                if (target.stance == PersonStance.KNOCKEDOUT) {
                     reaction = ActionAttackReaction.RESIST;
+                } else {
+                    if (target == WorldState.player) {
+                        Elements.CurrentTurnHandler.printAsContent(new Say(action.actor, " ", ActionAttack.gettingAttacked.getOne()));
+                        let choices = ["Counter-Attack", "Dodge", "Resist"];
+                        let choice = await Controls.giveChoices(false, ...choices);
+                        if (choice[1] == 0) {
+                            reaction = ActionAttackReaction.COUNTERATTACK;
+                        } else if (choice[1] == 2) {
+                            reaction = ActionAttackReaction.DODGE;
+                        } else {
+                            reaction = ActionAttackReaction.RESIST;
+                        }
+                    }
                 }
-            }
 
-            let weapons = action.getWeapons();
-            for (let i = 0; i < weapons.length; i++) {
-                (<Person> action.actor).changeStamina(- weapons[i].attackCost);
-            }
-            if (weapons.length == 0) {
-                (<Person> action.actor).changeStamina(- ActionAttack.fistCost)
-            }
+                let weapons = action.getWeapons();
+                for (let i = 0; i < weapons.length; i++) {
+                    (<Person> action.actor).changeStamina(- weapons[i].attackCost);
+                }
+                if (weapons.length == 0) {
+                    (<Person> action.actor).changeStamina(- ActionAttack.fistCost)
+                }
 
-            action.targetReaction = reaction;
+                action.targetReaction = reaction;
 
-            if (reaction == ActionAttackReaction.DODGE) {
-                (<Person> target).changeStamina(- ActionAttack.dodgeCost);
-                let attack =  Math.floor(Math.random() * (ActionAttack.randomness + ActionAttack.randomness + 1)) - ActionAttack.randomness;
-                let defense = Math.floor(Math.random() * (ActionAttack.randomness + ActionAttack.randomness + 1)) - ActionAttack.randomness;
-                attack += actorDex;
-                defense += targetDex;
-                if (attack < defense) {
-                    action.generateDescription(
-                        (new ContentGroup())
-                            .addUnit(
-                                (new CombatUnit())
-                                    .setActor(action.actor)
-                                    .setTarget(target)
-                                    .setWeapon(...weapons)
-                                    .addMarker(CombatHit.MISS)
-                            )
-                    );
-                    return false;
+                if (reaction == ActionAttackReaction.DODGE) {
+                    (<Person> target).changeStamina(- ActionAttack.dodgeCost);
+                    let attack =  Math.floor(Math.random() * (ActionAttack.randomness + ActionAttack.randomness + 1)) - ActionAttack.randomness;
+                    let defense = Math.floor(Math.random() * (ActionAttack.randomness + ActionAttack.randomness + 1)) - ActionAttack.randomness;
+                    attack += actorDex;
+                    defense += targetDex;
+                    if (attack < defense) {
+                        action.generateDescription(
+                            (new ContentGroup())
+                                .addUnit(
+                                    (new CombatUnit())
+                                        .setActor(action.actor)
+                                        .setTarget(target)
+                                        .setWeapon(...weapons)
+                                        .addMarker(CombatHit.MISS)
+                                )
+                        );
+                        return false;
+                    }
                 }
             }
         }

+ 2 - 2
app/World/Classes/Action/ActionDropDown.ts

@@ -16,14 +16,14 @@ class ActionDropDown extends Action {
         return "stand up"
     }
 
-    public checkStand = ActionDropDown.check.createAndAddRule({
+    public static checkStand = ActionDropDown.check.createAndAddRule({
         name : "Stand - Can get down?",
         code : (rulebook) => {
             // TODO: Check if being held up
         }
     });
 
-    public carryStand = ActionDropDown.carry.createAndAddRule({
+    public static carryStand = ActionDropDown.carry.createAndAddRule({
         name : "Stand - Rise up!",
         code : (runner : RulebookRunner<ActionDropDown>) => {
             let actor = runner.noun.actor;

+ 2 - 2
app/World/Classes/Action/ActionStand.ts

@@ -16,7 +16,7 @@ class ActionStand extends Action {
         return "stand up"
     }
 
-    public checkStand = ActionStand.check.createAndAddRule({
+    public   static checkStand = ActionStand.check.createAndAddRule({
         name : "Stand - Can stand?",
         code : (rulebook) => {
             // TODO: Check if being held down
@@ -24,7 +24,7 @@ class ActionStand extends Action {
         }
     });
 
-    public carryStand = ActionStand.carry.createAndAddRule({
+    public  static carryStand = ActionStand.carry.createAndAddRule({
         name : "Stand - Rise up!",
         code : (runner : RulebookRunner<ActionStand>) => {
             let actor = runner.noun.actor;

+ 1 - 1
sass/__imagesRelative.scss

@@ -1,3 +1,3 @@
 .introLogo {
   background-image: url("../images/IntroLogo.svg");
-}
+}

+ 1 - 3
sass/fonts.scss

@@ -1,5 +1,3 @@
 // Fonts
 @import "fonts/_ssans";
-
-//TODO: Readd if status line gets back
-//@import "fonts/_cousine";
+@import "fonts/_cousine";

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 203 - 0
stylesheets/fonts.css


+ 11 - 29
stylesheets/images.css

@@ -2,45 +2,27 @@
  ** Calculate amount of steps from that
  ** Profit
  **/
-.anims-sprite, .anims-hairdoTest, .anims-pixelPrecisionTest, .anims-winner, .anims-orcNoShadow, .anims-orcStand, .anims-playerBody {
-  background-image: url('images/anims-s024dfdce19.png');
+.anims-sprite, .anims-orcStand, .anims-mainBody, .anims-pixel0 {
+  background-image: url('images/anims-sad0922e873.png');
   background-repeat: no-repeat;
 }
 
-.anims-hairdoTest {
+.anims-orcStand {
   background-position: 0 0;
   height: 200px;
-  width: 400px;
-}
-
-.anims-pixelPrecisionTest {
-  background-position: 0 -200px;
-  height: 327px;
-  width: 327px;
-}
-
-.anims-winner {
-  background-position: 0 -527px;
-  height: 200px;
-  width: 400px;
-}
-
-.anims-orcNoShadow {
-  background-position: 0 -727px;
-  height: 200px;
   width: 800px;
 }
 
-.anims-orcStand {
-  background-position: 0 -927px;
-  height: 200px;
-  width: 800px;
+.anims-mainBody {
+  background-position: 0 -200px;
+  height: 300px;
+  width: 1200px;
 }
 
-.anims-playerBody {
-  background-position: 0 -1127px;
-  height: 100px;
-  width: 100px;
+.anims-pixel0 {
+  background-position: 0 -500px;
+  height: 155px;
+  width: 262px;
 }
 
 .bg-Forest {

+ 7 - 21
stylesheets/screenLink.css

@@ -230,27 +230,6 @@ body {
   padding: 0.8rem;
 }
 
-#sceneAnimation {
-  display: none;
-  width: 200px;
-  height: 200px;
-  position: fixed;
-  bottom: 0px;
-  left: 50%;
-  margin-left: -100px;
-  z-index: 1;
-  pointer-events: none;
-}
-
-#mainPage.turn #sceneAnimation {
-  display: block;
-}
-
-.sceneAnimation {
-  display: block;
-  position: absolute;
-}
-
 #roomExitsHolder {
   background: linear-gradient(to top left, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.09) 50%, rgba(0, 0, 0, 0.06) 100%);
   padding: 2ex;
@@ -310,6 +289,13 @@ body.modal #modalWindow {
   transition: filter .3s ease-in-out;
 }
 
+#sceneAnimation {
+  transition: opacity  .3s ease-in-out;
+}
+
+#mainPage.turn #sceneAnimation {
+  opacity: 1;
+}
 #mainPage.turn #leftWindow, #mainPage.turn #rightWindow, #mainPage.turn #currentRoomTab, #mainPage.turn #hyperlinksTab, #mainPage.turn #fakeparserTab, #mainPage.turn #statusLine {
   pointer-events: none;
   filter: blur(2px);

+ 11 - 29
stylesheets/screenRelative.css

@@ -932,45 +932,27 @@ p.turnStart::before, p.turnStart::after {
  ** Calculate amount of steps from that
  ** Profit
  **/
-.anims-sprite, .anims-hairdoTest, .anims-pixelPrecisionTest, .anims-winner, .anims-orcNoShadow, .anims-orcStand, .anims-playerBody {
-  background-image: url('images/anims-s024dfdce19.png');
+.anims-sprite, .anims-orcStand, .anims-mainBody, .anims-pixel0 {
+  background-image: url('images/anims-sad0922e873.png');
   background-repeat: no-repeat;
 }
 
-.anims-hairdoTest {
+.anims-orcStand {
   background-position: 0 0;
   height: 200px;
-  width: 400px;
-}
-
-.anims-pixelPrecisionTest {
-  background-position: 0 -200px;
-  height: 327px;
-  width: 327px;
-}
-
-.anims-winner {
-  background-position: 0 -527px;
-  height: 200px;
-  width: 400px;
-}
-
-.anims-orcNoShadow {
-  background-position: 0 -727px;
-  height: 200px;
   width: 800px;
 }
 
-.anims-orcStand {
-  background-position: 0 -927px;
-  height: 200px;
-  width: 800px;
+.anims-mainBody {
+  background-position: 0 -200px;
+  height: 300px;
+  width: 1200px;
 }
 
-.anims-playerBody {
-  background-position: 0 -1127px;
-  height: 100px;
-  width: 100px;
+.anims-pixel0 {
+  background-position: 0 -500px;
+  height: 155px;
+  width: 262px;
 }
 
 .bg-Forest {

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно