Ver código fonte

Merge branch 'Edited-TW' into Sex

Stephan Fuchs 8 meses atrás
pai
commit
428052437b

+ 88 - 0
sugarcube/src/mods/example/exampleMod.tw

@@ -0,0 +1,88 @@
+:: intro_sg_select_char_after[mod modExample]
+<<act 'Godess'>>
+    <<gt 'modExample_intr_sg_select_godess'>>
+<</act>>
+
+
+:: modExample_intr_sg_select_godess[mod modExample]
+    <h2>Godess</h2>
+	<<image "mods/example/start.jpg">>
+	<p>
+		Strong, intelligent and beautiful: some people think that you have a divine touch.
+	</p>
+	<<actCLA 'Select another option'>>
+		<<gt 'intro_sg_select_char'>>
+	<</actCLA>>
+	<<actCLA 'Confirm this option'>>
+		<<gs 'intro_sg_select_char_nerd'>>
+
+		<<set $pc.legHair = -1>>
+		<<set $pc.pcs_hairbsh = 1>>
+		<<set $finances.cash = 20000>>
+		<<set $alterstrtimg = 8>>
+		<<run $pc.skillSetLevel('charisma',100)>>
+		<<run $pc.skillSetLevel('spirit',100)>>
+		<<run $pc.skillSetLevel('iceskating',100)>>
+		<<run $pc.skillSetLevel('people',100)>>
+		<<run $pc.skillSetLevel('persuasion',100)>>
+		<<run $pc.skillSetLevel('makeup',100)>>
+		<<run $pc.skillSetLevel('agility',100)>>
+		<<run $pc.skillSetLevel('strength',100)>>
+		<<run $pc.skillSetLevel('reaction',100)>>
+		<<set $pc.pcs_inhib = 40>>
+		<<run $pc.skillSetLevel('highHeels',100)>>
+		<<set $pirsC = 2>>
+		<<set $PirsC2_owned = 1>>
+		<<set $currentpursetype = 'fashionista'>>
+		<<set $currentpursenumber = 13>>
+		<<setinit $fashionista_purses[13] = 1>>
+		<<set $bag = 1>>
+		<<gs 'npc_relationship' 'socialgroup_setting' 10 5 10 5 5 5>>
+		<<run $npcs.set('A18','rel',1)>>
+		<!-- !!make sure this coming after the gs code above will still set christina to a 1 relationship, if I did this code correctly, if not look for this code in other spots and fix it pls-->
+		<<run $q.school.func('groupRelSet','cool',300)>>
+		<<run $q.school.func('groupRelSet','nerds',900)>>
+		<<run $q.school.func('groupRelSet','teachers',700)>>
+		<<set $kosmetica = 10>>
+		<<set $stanok = 10>>
+		<<if getvar("$player_avatar") == 0>>
+			<<set $pc.pcs_hairlng = 300>>
+			<<set $pc.eyesize = 3>>
+			<<set $pc.lip_size = 2>>
+			<<set $pc.eyelashes = 1>>
+		<</if>>
+		<<set $pc.pcs_skin = 2000>>
+		<<set $pc.pcs_teeth = 0>>
+
+		<<set $pc.genbsize = 30>>
+		<!-- !!d cup for ideal bmi-->
+		<<set $pc.salo = 105>>
+		<<set $pc.willpowermax = 100>>
+		<<run $q.school.func('grade_award','math',85)>>
+		<<run $q.school.func('grade_award','rus',90)>>
+		<<run $q.school.func('grade_award','lit',80)>>
+		<<run $q.school.func('grade_award','art',75)>>
+		<<run $q.school.func('grade_award','bio',80)>>
+		<<run $q.school.func('grade_award','pe',60)>>
+		<<run $q.school.func('grade_award','eng',85)>>
+		<<run $q.school.func('grade_award','geo',80)>>
+		<<run $q.school.func('grade_award','sci',80)>>
+		<<run $q.school.func('grade_award','shop',55)>>
+		<<run $q.school.func('grade_award','comp',80)>>
+		<<run $q.school.func('grade_award','mus',75)>>
+		<<run $q.school.func('grade_award','his',80)>>
+		<<set $pc.glass = 0>>
+		<<set $pc.hairColor = 3>>
+		<<set $pc.pcs_teeth = -1>>
+		<<set $pc.modExample_isGodessStart = true>>
+		<<gt 'intro_sg_finalize'>>
+	<</actCLA>>
+
+:: intro_initialization_after[mod modExample]
+<<if $pc.modExample_isGodessStart>>
+	<<run $wardrobe.wear(['clothes','moncheri',16,'gown'])>>
+	<<run $wardrobe.wear(['shoes','moncheri',59])>>
+	<<run $wardrobe.wear(['coat','moncheri',7])>>
+	<<run $wardrobe.wear(['bra','lusso',18])>>
+	<<run $wardrobe.wear(['panties','lusso',18])>>
+<</if>>

+ 26 - 13
sugarcube/src/npcs/_system/NPCsDict.js

@@ -257,19 +257,32 @@ class NPCsDict{
         return data;
     }
 
-    npcFitsFilter(npcId,filters={}){
-        for (const [filterKey, filterValue] of Object.entries(filters)) {
-            let npcValue = undefined;
-            if(typeof filterValue === "number")
-                npcValue = this.get(npcId,filterKey,0);
-            else
-                npcValue = this.get(npcId,filterKey,'');
-            if(npcValue != filterValue){
-                return false;
-            }
-        }
-        return true;
-    }
+	npcFitsFilter(npcId,filters={}){
+		outerLoop:for (const [filterKey, filterValue] of Object.entries(filters)) {
+			let npcValue = undefined;
+
+			if(typeof filterValue === "object" && filterValue.filter){
+				
+				switch(filterValue.filter){
+					case 'minMax':
+						let min = filterValue.min ?? -Infinity;
+						let max = filterValue.max ?? Infinity;
+						npcValue = this.get(npcId,filterKey,0);
+						if(npcValue > max || npcValue < min)
+							return false;
+						continue outerLoop;
+				}
+			}
+			else if(typeof filterValue === "number")
+				npcValue = this.get(npcId,filterKey,0);
+			else
+				npcValue = this.get(npcId,filterKey,'');
+			if(npcValue != filterValue){
+				return false;
+			}
+		}
+		return true;
+	}
 
 	npcLikesAppearance(npcId){
 		let appearanceDemand = this.get(npcId,'appearanceDemand',[null,null,5]);