Reddo 5 rokov pred
rodič
commit
c4aad35fcb

+ 40 - 40
app/World/Classes/ContentPicker/ContentDescription.ts

@@ -1,8 +1,8 @@
 class ContentDescription {
     public name : string;
     public group : ContentUnit | ContentGroup;
-	public description : Say | ((description : ContentDescription, group : ContentUnit | ContentGroup) => Say);
-	private saidCount = 0;
+    public description : Say | ((description : ContentDescription, group : ContentUnit | ContentGroup) => Say);
+    private saidCount = 0;
 
     public constructor (name : string, group : ContentUnit | ContentGroup) {
         this.name = name;
@@ -10,37 +10,37 @@ class ContentDescription {
     }
 
     public getScore () {
-    	return (this.group).getScore();
-	}
-	
-	public getDescription (group : ContentUnit | ContentGroup) : Say {
-		this.saidCount++;
-		if (typeof this.description == "function") {
-		    return this.description(this, group);
+        return (this.group).getScore();
+    }
+
+    public getDescription (group : ContentUnit | ContentGroup) : Say {
+        this.saidCount++;
+        if (typeof this.description == "function") {
+            return this.description(this, group);
+        }
+        return this.description;
+    }
+
+    public setDescription (description : Say | string | ((description : ContentDescription, group : ContentUnit | ContentGroup) => Say) ) {
+        if (!(description instanceof Say)) {
+            this.description = new Say(description);
+        } else {
+            this.description = description;
         }
-		return this.description;
-	}
+        return this;
+    }
 
-	public setDescription (description : Say | string | ((description : ContentDescription, group : ContentUnit | ContentGroup) => Say) ) {
-    	if (!(description instanceof Say)) {
-    		this.description = new Say(description);
-		} else {
-    		this.description = description;
-		}
-		return this;
-	}
-	
-	public static pickDescriptions (cda : Array<ContentDescription>, target : ContentGroup | ContentUnit) : Array<Say> {
-		let a = cda.slice();
-		let groups = [];
-		for (let i = 0; i < a.length; i++) {
+    public static pickDescriptions (cda : Array<ContentDescription>, target : ContentGroup | ContentUnit) : Array<Say> {
+        let a = cda.slice();
+        let groups = [];
+        for (let i = 0; i < a.length; i++) {
             let randomIndex = Math.floor(Math.random() * (a.length - i)) + i;
             let temp = a[i];
             a[i] = a[randomIndex];
             a[randomIndex] = temp;
         }
-		
-		// After shuffling the list, descriptions with the highest scores go at the top, and between those the ones with the lowest saidCounts go first
+
+        // After shuffling the list, descriptions with the highest scores go at the top, and between those the ones with the lowest saidCounts go first
         // If multiple descriptions have the same score/saidCount, they are picked randomly due to the previous shuffling.
         a.sort((a : ContentDescription, b : ContentDescription) => {
             let scoreA = a.getScore() / (a.saidCount + 1);
@@ -49,21 +49,21 @@ class ContentDescription {
             return 0;
         });
 
-		a.forEach(description => {
-			groups.push(description.group);
-		});
+        a.forEach(description => {
+            groups.push(description.group);
+        });
 
         let matches = (<any> target).matchAgainst(<any> groups);
         if (matches != undefined) {
-			let result = [];
-			matches.forEach(i => {
-				result.push(a[i].getDescription(target));
-				result.push(new Say(" "));
-			});
-			return result;
-		} else {
-        	console.warn("No description available for", target);
-        	return [new Say("Warning: No description available for the current situation. Please report so it can be corrected.")];
-		}
-	}
+            let result = [];
+            matches.forEach(i => {
+                result.push(a[i].getDescription(target));
+                result.push(new Say(" "));
+            });
+            return result;
+        } else {
+            console.warn("No description available for", target);
+            return [new Say("Warning: No description available for the current situation. Please report so it can be corrected.")];
+        }
+    }
 }

+ 1 - 1
app/World/Classes/ContentPicker/ContentGroup.ts

@@ -64,7 +64,7 @@ class ContentGroup {
             score += unit.getScore();
         });
 
-        return Math.floor((score / this.units.length) * 10) + this.units.length; // If we keep precision too high, random won't work.
+        return score;
     }
 
     public matchAgainst (a : Array<ContentGroup>) : Array<number> {

+ 26 - 3
content/main.ts

@@ -261,12 +261,28 @@ fTarget.addUnit(
         .setFucker(randomOrc)
         .setHole(WorldState.player.getPart(HumanoidVagina))
         .setStick(randomOrc.getPart(HumanoidPenis))
-        .addMarker(FuckingState.CUM_START)
+);
+fTarget.addUnit(
+    new FuckingUnit()
+        .setFucked(WorldState.player)
+        .setFucker(randomOrc2)
+        .setHole(WorldState.player.getPart(HumanoidHead))
+        .setStick(randomOrc2.getPart(HumanoidPenis))
 );
 
+let spitroast = (new FuckingDescription("Orc spitroast!"));
+spitroast.setDescription(new Say("Orc Spitroast!"))
+    .addUnit()
+    .setFucker(OrcDebugger)
+    .setHole(HumanoidVagina)
+    .setStick(HumanoidPenis);
+spitroast.addUnit()
+    .setFucker(OrcDebugger)
+    .setHole(HumanoidHead)
+    .setStick(HumanoidPenis);
 
 (new FuckingDescription("Specific Orc in Vagina"))
-    .setDescription(new Say("Specific Orc in Vagina"))
+    .setDescription(new Say("Specific Orc in Vagina."))
     .addUnit()
     .setFucker(randomOrc)
     .setHole(WorldState.player.getPart(HumanoidVagina))
@@ -278,4 +294,11 @@ fTarget.addUnit(
     .setFucker(randomOrc)
     .setHole(WorldState.player.getPart(HumanoidVagina))
     .addMarker(FuckingState.CUM_START)
-    .setStick(randomOrc.getPart(HumanoidPenis));
+    .setStick(randomOrc.getPart(HumanoidPenis));
+
+(new FuckingDescription("Orc in mouth"))
+    .setDescription(new Say("Orc in mouth."))
+    .addUnit()
+    .setFucker(OrcDebugger)
+    .setHole(HumanoidHead)
+    .setStick(HumanoidPenis);