Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pregmodfan
fc-pregmod
Commits
adf75195
Commit
adf75195
authored
4 years ago
by
brickode
Browse files
Options
Downloads
Patches
Plain Diff
Disabled LinkList for now, updated JSDocs
parent
a30be73c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7685
Major Sex Interaction Expansion
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/interaction/useSlave.js
+87
-56
87 additions, 56 deletions
src/interaction/useSlave.js
with
87 additions
and
56 deletions
src/interaction/useSlave.js
+
87
−
56
View file @
adf75195
...
@@ -54,12 +54,12 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -54,12 +54,12 @@ App.UI.SlaveInteract.useSlave = function(slave) {
class
Link
{
class
Link
{
/**
/**
* @param {string} link The link text.
* @param {string} link The link text.
* @param {string
|Node
} desc The text displayed when link is clicked.
* @param {string} desc The text displayed when link is clicked.
* @param {HTMLElement} [parent] The parent node to attach the link to.
* @param {HTMLElement} [parent] The parent node to attach the link to.
* @param {string} [type
="span"
] The type of element to create.
* @param {string} [type] The type of element to create.
* @param {HTMLElement|HTMLElement[]} [nodes] Any nodes to attach.
* @param {HTMLElement|HTMLElement[]} [nodes] Any nodes to attach.
*/
*/
constructor
(
link
,
desc
,
parent
,
type
,
nodes
)
{
constructor
(
link
,
desc
,
parent
,
type
,
nodes
=
[]
)
{
this
.
link
=
link
;
this
.
link
=
link
;
this
.
desc
=
desc
;
this
.
desc
=
desc
;
this
.
parent
=
parent
;
this
.
parent
=
parent
;
...
@@ -71,17 +71,20 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -71,17 +71,20 @@ App.UI.SlaveInteract.useSlave = function(slave) {
}
}
/**
/**
* @param {HTMLElement[]} nodes Any nodes to attach to the link.
* @param {HTMLElement
|HTMLElement
[]} nodes Any nodes to attach to the link.
*/
*/
append
(...
nodes
)
{
append
(
nodes
)
{
this
.
fullLink
.
append
(...
nodes
);
if
(
Array
.
isArray
(
nodes
))
{
this
.
fullLink
.
append
(...
nodes
);
}
else
{
this
.
fullLink
.
appendChild
(
nodes
);
}
return
this
;
return
this
;
}
}
/**
/**
* @template {keyof HTMLElementTagNameMap} K
* @param {string} type The type of element the link will be.
* @param {K} type The type of element the link will be.
*/
*/
replace
(
type
)
{
replace
(
type
)
{
/** @type {HTMLElement} */
/** @type {HTMLElement} */
...
@@ -103,7 +106,14 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -103,7 +106,14 @@ App.UI.SlaveInteract.useSlave = function(slave) {
return
this
;
return
this
;
}
}
/**
* Generates the full link and appends it to `parent`.
*/
generate
()
{
generate
()
{
this
.
append
(
this
.
nodes
);
this
.
replace
(
this
.
type
);
this
.
appendTo
(
this
.
parent
);
return
this
.
fullLink
;
return
this
.
fullLink
;
}
}
}
}
...
@@ -133,16 +143,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -133,16 +143,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
}
}
}
}
/** A class for creating lists of links. */
class
List
{
class
LinkList
{
constructor
(...
args
)
{
/**
this
.
args
=
args
;
* An array of all options.
* @param {Option[]} options
*/
constructor
(
options
)
{
this
.
options
=
options
;
/** @param {Option[]} filtered An array of all available options. */
this
.
filtered
=
[];
}
}
/**
/**
...
@@ -150,10 +153,51 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -150,10 +153,51 @@ App.UI.SlaveInteract.useSlave = function(slave) {
* @param {Option[]} args A list of Options to add.
* @param {Option[]} args A list of Options to add.
*/
*/
addOptions
(
args
)
{
addOptions
(
args
)
{
this
.
option
s
.
push
(...
args
);
this
.
arg
s
.
push
(...
args
);
return
this
;
return
this
;
}
}
}
/** A class for creating lists of links. */
// class LinkList extends List {
// /**
// * @param {Link[]} links An array of all links.
// */
// constructor(links) {
// super(links);
// this.links = links;
// }
// /**
// * Generates and returns a link strip.
// * @param {HTMLElement} div The main div whose text will be replaced.
// * @returns {HTMLElement}
// */
// generateLinks(div) {
// const links = [];
// const linksDiv = document.createElement("div");
// this.links.forEach(link => links.push(App.UI.DOM.link(link.link, () => {
// div.innerHTML = link.desc;
// })));
// linksDiv.appendChild(App.UI.DOM.generateLinksStrip(links));
// return linksDiv;
// }
// }
class
OptionList
extends
List
{
/**
* @param {Option[]} options An array of all options.
*/
constructor
(
options
)
{
super
(
options
);
this
.
options
=
options
;
}
/**
/**
* Filters out all options whose requirements are not met.
* Filters out all options whose requirements are not met.
...
@@ -167,8 +211,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -167,8 +211,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
/**
/**
* Generates and returns a link strip.
* Generates and returns a link strip.
* @param {HTMLElement} div The main div whose text will be replaced.
* @param {HTMLElement} div The main div whose text will be replaced.
* @returns {HTMLElement}
*/
*/
generate
Link
s
(
div
)
{
generate
Option
s
(
div
)
{
/** @type {HTMLAnchorElement[]} */
/** @type {HTMLAnchorElement[]} */
const
links
=
[];
const
links
=
[];
const
linksDiv
=
document
.
createElement
(
"
div
"
);
const
linksDiv
=
document
.
createElement
(
"
div
"
);
...
@@ -281,32 +326,18 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -281,32 +326,18 @@ App.UI.SlaveInteract.useSlave = function(slave) {
const
introSpan
=
App
.
UI
.
DOM
.
makeElement
(
"
span
"
,
`Use
${
him
}
and take control: `
);
const
introSpan
=
App
.
UI
.
DOM
.
makeElement
(
"
span
"
,
`Use
${
him
}
and take control: `
);
if
(
tempSlave
.
devotion
>
50
)
{
if
(
tempSlave
.
devotion
>
50
)
{
// const intro = new LinkList(
new
Link
(
// [
`Have sex with
${
him
}
`
,
// new Link(
`You pull
${
tempSlave
.
slaveName
}
in close and tell
${
him
}
that you want to make love. With
${
// `Have sex with ${him}`,
tempSlave
.
mouthAccessory
===
none
?
// `You pull ${tempSlave.slaveName} in close and tell ${him} that you want to make love. With ${
`a
${
Beauty
(
tempSlave
)
>
150
&&
tempSlave
.
face
>
10
?
`pretty`
:
`quick`
}
smile`
:
// tempSlave.mouthAccessory === none ?
`as much of a smile as
${
his
}
${
tempSlave
.
mouthAccessory
}
will allow`
// `a ${Beauty(tempSlave) > 150 && tempSlave.face > 10 ? `pretty` : `quick`} smile` :
}
,
${
he
}
makes it clear that your advances are not unwanted.`
,
// `as much of a smile as ${his} ${tempSlave.mouthAccessory} will allow`
introSpan
,
// }, ${he} makes it clear that your advances are not unwanted.`,
"
span
"
,
// )
generateOptions
(),
// ]
)
// )
.
generate
();
// .generateLinks(introSpan);
// if (tempSlave.devotion > 50) {
// const intro = App.UI.DOM.makeElement("div", `You pull ${tempSlave.slaveName} in close and tell ${him} that you want to make love. With ${
// tempSlave.mouthAccessory === none ?
// `a ${Beauty(tempSlave) > 150 && tempSlave.face > 10 ? `pretty` : `quick`} smile` :
// `as much of a smile as ${his} ${tempSlave.mouthAccessory} will allow`
// }, ${he} makes it clear that your advances are not unwanted.`);
// intro.appendChild(generateOptions());
// introSpan.appendChild(App.UI.DOM.linkReplace(
// `Have sex with ${him}`,
// intro
// ));
return
introSpan
;
return
introSpan
;
}
else
if
(
tempSlave
.
devotion
>
20
)
{
}
else
if
(
tempSlave
.
devotion
>
20
)
{
...
@@ -341,7 +372,7 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -341,7 +372,7 @@ App.UI.SlaveInteract.useSlave = function(slave) {
const
test
=
/^
[
a
\s
|an
\s]
/
;
// any "a" or "an" at the beginning of a string
const
test
=
/^
[
a
\s
|an
\s]
/
;
// any "a" or "an" at the beginning of a string
const
face
=
new
Link
List
(
const
face
=
new
Option
List
(
[
[
new
Option
(
new
Option
(
`Kiss
${
him
}
`
,
`Kiss
${
him
}
`
,
...
@@ -392,9 +423,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -392,9 +423,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
)
)
]
]
)
)
.
generate
Link
s
(
optionsDiv
);
.
generate
Option
s
(
optionsDiv
);
const
chest
=
new
Link
List
(
const
chest
=
new
Option
List
(
[
[
new
Option
(
new
Option
(
`Grope
${
his
}
chest`
,
`Grope
${
his
}
chest`
,
...
@@ -434,9 +465,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -434,9 +465,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
)
)
]
]
)
)
.
generate
Link
s
(
optionsDiv
);
.
generate
Option
s
(
optionsDiv
);
const
crotch
=
new
Link
List
(
const
crotch
=
new
Option
List
(
[
[
new
Option
(
new
Option
(
`Finger
${
his
}
pussy`
,
`Finger
${
his
}
pussy`
,
...
@@ -476,9 +507,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -476,9 +507,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
),
),
]
]
)
)
.
generate
Link
s
(
optionsDiv
);
.
generate
Option
s
(
optionsDiv
);
const
general
=
new
Link
List
(
const
general
=
new
Option
List
(
[
[
new
Option
(
new
Option
(
`Have
${
him
}
dance for you`
,
`Have
${
him
}
dance for you`
,
...
@@ -567,9 +598,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -567,9 +598,9 @@ App.UI.SlaveInteract.useSlave = function(slave) {
// },
// },
]
]
)
)
.
generate
Link
s
(
optionsDiv
);
.
generate
Option
s
(
optionsDiv
);
const
clothing
=
new
Link
List
(
const
clothing
=
new
Option
List
(
[
[
// new Option(
// new Option(
// `Pull up ${his} dress`,
// `Pull up ${his} dress`,
...
@@ -658,7 +689,7 @@ App.UI.SlaveInteract.useSlave = function(slave) {
...
@@ -658,7 +689,7 @@ App.UI.SlaveInteract.useSlave = function(slave) {
),
),
]
]
)
)
.
generate
Link
s
(
optionsDiv
);
.
generate
Option
s
(
optionsDiv
);
optionsDiv
.
append
(
face
,
chest
,
crotch
,
general
,
clothing
);
optionsDiv
.
append
(
face
,
chest
,
crotch
,
general
,
clothing
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment