123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- :: NPCFunctions[include]
- <<switch $location_var[$here][0]>>
- <<case 'relationshipDescription'>>
- <<set $result = ''>>
- <<set _npcFam = $npcs.get($location_var[$here][1],'fam')>>
- /*<<if _npcFam < 5>>
- <<set $result += "You don't know each other.">>
- <<elseif _npcFam < 20>>
- <<set $result += "You barely know each other.">>
- <<elseif _npcFam < 100>>
- <<set $result += "You know little about each other.">>
- <<elseif _npcFam < 300>>
- <<set $result += "You are acquainted with each other.">>
- <<elseif _npcFam < 500>>
- <<set $result += "You somewhat know each other.">>
- <<elseif _npcFam < 700>>
- <<set $result += "You are familiar with each other.">>
- <<elseif _npcFam < 800>>
- <<set $result += "You are very familiar with each other.">>
- <<elseif _npcFam < 900>>
- <<set $result += "You are extremely familiar with each other.">>
- <<else>>
- <<set $result += "You are extremely familiar with each other.">>
- <</if>>*/
- <<if _npcFam < 5>>
- <<set $result += "You don't know each other.">>
- <<elseif _npcFam < 20>>
- <<set $result += "You barely know each other.">>
- <<elseif _npcFam < 200>>
- <<set $result += "You know each other as well as colleagues or class mates do.">>
- <<elseif _npcFam < 400>>
- <<set $result += "You know each other as well as friends do.">>
- <<elseif _npcFam < 600>>
- <<set $result += "You know each other as well as close friends do.">>
- <<elseif _npcFam < 800>>
- <<set $result += "You know each other as well as best friends do.">>
- <<elseif _npcFam < 900>>
- <<set $result += "You know each other as well as close family members do.">>
- <<else>>
- <<set $result += "You know each other as well as soul mates do.">>
- <</if>>
- <<set $result += ' '>>
- <<set _npcRel = $npcs.get($location_var[$here][1],'rel')>>
- <<if _npcRel < 20>>
- <<set $result += 'Your relationship is awful.'>>
- <<elseif _npcRel < 40>>
- <<set $result += 'Your relationship is tense.'>>
- <<elseif _npcRel < 60>>
- <<set $result += 'You have a normal relationship.'>>
- <<elseif _npcRel < 80>>
- <<set $result += 'You have a good relationship.'>>
- <<else>>
- <<set $result += 'You have a great relationship.'>>
- <</if>>
- <</switch>>
- :: NPC_Widgets[widget]
- <<widget 'npc' container>>
- <<set _npcId = _args[0]>>
- <!-- Present NPCs -->
- <<if !_presentNPCs>><<set _presentNPCs = {}>><</if>>
- <<set _presentNPCs[_npcId] = passage()>>
- <<set _displayedName = _args[1]>>
- <<if !_displayedName>>
- <<set _displayedName = $npcs.get(_npcId,'usedname')>>
- <</if>>
- <<set _c to _contents>>
- <<capture _c>>
- <<set _note = $npcs.get(_npcId,'notes')>>
- <<set _image = $npcs.get(_npcId,'image')>>
- <<if _image>>
- <<set _note = "<<image '"+_image+"'>>" + _note>>
- <</if>>
- <<set _note += '<hr/>'+func('NPCFunctions','relationshipDescription',_npcId)>>
- <<if _note>>
- <<linkWithTooltip _displayedName _note>>_c<</linkWithTooltip>>
- <<else>>
- <<link _displayedName>>
- _c
- <</link>>
- <</if>>
- <</capture>>
- <</widget>>
- <<widget 'npcDecription'>>
- <<set _npcId = _args[0]>>
- <<set _gender = $npcs.get(_npcId,'gender')>> <!-- 0: male, 1: female -->
- <<if _gender === 0>>
- <<set _l = {he:'he',him:'him',his:'his'}>>
- <<else>>
- <<set _l = {he:'she',him:'her',his:'her'}>>
- <</if>>
- <<for _key,_value range _l>>
- <<set _l[_key.toUpperFirst()] = _value.toUpperFirst()>>
- <</for>>
- <<set _age = $npcs.get(_npcId,'age')>>
- <<set _ageDecade = Math.floor(_age/10)>>
- <<if _age <= 1>>
- _l.He is an infant.
- <<elseif _age <= 5>>
- _l.He is a little child.
- <<elseif _age <= 12>>
- _l.He is a child.
- <<elseif _age <= 14>>
- _l.He is in _l.his early teens.
- <<elseif _age < 20>>
- _l.He is a teenager.
- <<elseif _age <= 23>>
- _l.He is in _l.his early twenties.
- <<elseif _age <= 26>>
- _l.He is in _l.his mid-twenties.
- <<elseif _age < 30>>
- _l.He is in _l.his late twenties.
- <<elseif _age <= 33>>
- _l.He is in _l.his early thirties.
- <<elseif _age <= 36>>
- _l.He is in _l.his mid-thirties.
- <<elseif _age < 40>>
- _l.He is in _l.his late thirties.
- <<elseif _age < 50>>
- _l.He is in _l.his forties.
- <<elseif _age < 60>>
- _l.He is in _l.his fifties.
- <<elseif _age < 70>>
- _l.He is in _l.his sixties.
- <<elseif _age < 80>>
- _l.He is in _l.his seventies.
- <<elseif _age >= 80>>
- _l.He is at least in _l.his eighties.
- <</if>>
- <<set _height = $npcs.get(_npcId,'height')>>
- <<set _heightApprox = Math.round(_height / 3) * 3>>
- <<set _pc_height = $pc.pcs_hgt>>
- <<set _heightQutient = _pc_height / _height>>
- <!-- Comment references are for Svetas default hight of 170cm -->
- <<if _heightQutient > 3.4>><!-- Smaller than 50cm -->
- _l.He is tiny.
- <<elseif _heightQutient > 2.4>><!-- Smaller than 70cm -->
- _l.He reaches up to your knees.
- <<elseif _heightQutient > 2.4>><!-- Smaller than 70cm -->
- _l.He reaches up to your knees.
- <<elseif _heightQutient > 1.9>><!-- Smaller than 90cm -->
- _l.He reaches up to your hips.
- <<elseif _heightQutient > 1.55>><!-- Smaller than 110cm -->
- _l.He reaches up to belly button.
- <<elseif _heightQutient > 1.3>><!-- Smaller than 130cm -->
- _l.He reaches up to your breasts.
- <<elseif _heightQutient > 1.13>><!-- Smaller than 150cm -->
- _l.He reaches up to your shoulder.
- <<elseif _heightQutient > 1.09>><!-- Smaller than 155cm -->
- _l.He reaches up to your chin.
- <<elseif _heightQutient > 1.09>><!-- Smaller than 160cm -->
- _l.He is a little smaller than you. You can barely look over _l.his head.
- <<elseif _heightQutient > 1.02>><!-- Smaller than 167cm -->
- _l.He is a tiny bit smaller than you.
- <<elseif _heightQutient > 0.98>><!-- Smaller than 173cm -->
- _l.He is almost the exact same height as you.
- <<elseif _heightQutient > 0.94>><!-- Smaller than 180cm -->
- _l.He is a tiny bit taller than you.
- <<elseif _heightQutient > 0.92>><!-- Smaller than 185cm -->
- _l.He is a little taller than you. _l.He can likely look above your head.
- <<elseif _heightQutient > 0.89>><!-- Smaller than 190cm -->
- _l.He is taller than you. Your eyes are as high as _l.his neck.
- <<elseif _heightQutient > 0.87>><!-- Smaller than 195cm -->
- _l.He is taller than you. Your eyes are as high as _l.his upper chest.
- <<elseif _heightQutient > 0.85>><!-- Smaller than 200cm -->
- _l.He is way taller than you. Your eyes are as high as _l.his chest.
- <<elseif _heightQutient > 0.77>><!-- Smaller than 220cm -->
- _l.He is way taller than you. Your eyes are as high as _l.his lower chest.
- <<elseif _heightQutient > 0.65>><!-- Smaller than 240cm -->
- _l.He is way taller than you. Your eyes are as high as _l.his belly.
- <<elseif _heightQutient > 0.5>><!-- Smaller than 240cm -->
- _l.He is way way taller than you. Your eyes are as high as _l.his hips.
- <<else>>
- _l.He is way way taller than you. Your don't even reach _l.his hips.
- <</if>>
- <</widget>>
- <<widget 'npcList'>>
- <<if ['array','object'].includes(typeof _args[0])>>
- <<set _npcNames = []>>
- <<for _key, _npcId range _args[0]>>
- <<if typeof _npcId == 'object'>>
- <<run _npcNames.push("<<npc '"+_key+"'>>"+(_npcId.contents ?? '')+"<</npc>>")>>
- <<else>>
- <<run _npcNames.push("<<npc '"+_npcId+"'>><</npc>>")>>
- <</if>>
- <</for>>
- <<if _args[2] and _npcNames.length > 1>>
- <<=_args[2].split('#')[0]>>
- <<elseif _args[1] and _npcNames.length > 0>>
- <<=_args[1].split('#')[0]>>
- <</if>>
- <<concatAnd _npcNames>>
- <<if _args[2] and _npcNames.length > 1>>
- <<=_args[2].split('#')[1]>>
- <<elseif _args[1] and _npcNames.length > 0>>
- <<=_args[1].split('#')[1]>>
- <</if>>
- <</if>>
- <</widget>>
- <<widget "npcLoad" container>>
- <<if !_autoCapture.loadedNPCIds>>
- <<set _autoCapture.loadedNPCIds = []>>
- <</if>>
- <<run _autoCapture.loadedNPCIds.push(_args[0])>>
- <!--<<set _loadedNPCId = _autoCapture.loadedNPCIds.last()>>-->
- _contents
- <<run _autoCapture.loadedNPCIds.pop()>>
- <!--<<if _autoCapture.loadedNPCIds.length > 0>>
- <<set _loadedNPCId = _autoCapture.loadedNPCIds.last()>>
- <<else>>
- <<set _loadedNPCId = undefined>>
- <</if>>-->
- <</widget>>
- <<widget 'npcPronoun'>>
- <<if Array.isArray(_args[0])>>
- <<if _args[0].length == 1>>
- <<set _npcGender = $npcs.get(_args[0][0]).gender>>
- <<else>>
- <<set _npcGender = -1>>
- <</if>>
- <<elseif typeof _args[0] == 'object'>>
- <<if Object.keys(_args[0]).length == 1>>
- <<set _npcGender = $npcs.get(Object.keys(_args[0])[0],'gender')>>
- <<else>>
- <<set _npcGender = -1>>
- <</if>>
- <<else>>
- <<set _npcGender = $npcs.get(_args[0]).gender>>
- <</if>>
- <<switch _npcGender>>
- <<case -1>>
- <<set _pronouns = {
- 'himherthem': 'them',
- 'HimHerThem': 'Them',
- }>>
- <<case 0>>
- <<set _pronouns = {
- 'himherthem': 'him',
- 'HimHerThem': 'Him',
- }>>
- <<case 1>>
- <<set _pronouns = {
- 'himherthem': 'her',
- 'HimHerThem': 'Her',
- }>>
- <</switch>>
- <<=_pronouns[_args[1]]>>
- <</widget>>
- <<widget 'npcRemember'>>
- <</widget>>
- <<widget 'g'>>
- <!--<<=$npcs.pronoun(_loadedNPCId,_args[0])>>-->
- <<=$npcs.pronoun(_autoCapture?.loadedNPCIds?.last(),_args[0])>>
- <</widget>>
- <<widget 'he'>>
- <<genderedWord `['he','she']` _args[0]>>
- <</widget>>
- <<widget 'He'>>
- <<genderedWord `['He','She']` _args[0]>>
- <</widget>>
- <<widget 'genderedWord'>>
- <<if _args[1]>>
- <<set _npcId = _args[1]>>
- <<elseif _autoCapture.loadedNPCIds>>
- <<set _npcId = _autoCapture.loadedNPCIds.last()>>
- <</if>>
- <<set _npcGender = $npcs.get(_npcId,'gender')>>
- <<switch _npcGender>>
- <<case 0>>
- <<=_args[0][0]>>
- <<case 1>>
- <<=_args[0][1]>>
- <<default>>
- <<=`'Key not found: '+_npcGender+' in <<genderedWord>>'`>>
- <</switch>>
- <</widget>>
|