Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • 1 18996468-Dulst-Community-TEST
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kaoru Aoi
  • 18996468-Dulst-Community-TEST
  • Wiki
  • javascript

javascript · Changes

Page history
Update javascript authored Apr 08, 2020 by Administrator's avatar Administrator
Show whitespace changes
Inline Side-by-side
javascript.md
View page @ a3c79ced
...@@ -36,20 +36,28 @@ console.log(dotSyntax('$variable.variable2')) ...@@ -36,20 +36,28 @@ console.log(dotSyntax('$variable.variable2'))
# Server side API # Server side API
## Global Variables
#### thisMatch
#### cardsList
Array of all card objects in this game, equivalent to `thisMatch.cardsList`
## Local Variables ## Local Variables
#### **thisCard** #### thisCard
#### **effectIndex** #### effectIndex
#### **effectIndex** #### effects
#### **effectIndex**
## Global Variables This line's effects. Equivalent to `thisCard.effects[effectIndex]`
> #### playerNumber
This card's playerNumber. Equivalent to `thisCard.playerNumber`
#### thisMatch
## Helper Functions ## Helper Functions
...@@ -59,7 +67,7 @@ console.log(dotSyntax('$variable.variable2')) ...@@ -59,7 +67,7 @@ console.log(dotSyntax('$variable.variable2'))
A number that is a ciid. A number that is a ciid.
#### **otherPlayer(*playerNumber*)** #### otherPlayer(*playerNumber*)
In games with 2 players, get the playerNumber of the other player. Returns either string `"player1"` or `"player2"` In games with 2 players, get the playerNumber of the other player. Returns either string `"player1"` or `"player2"`
...@@ -86,7 +94,7 @@ A string that evaluates to an effectIndex or an array of effectIndexes. ...@@ -86,7 +94,7 @@ A string that evaluates to an effectIndex or an array of effectIndexes.
Optional. Optional.
#### **runEffect(*thisMatch*, *options*, *callback*)** #### runEffect(*thisMatch*, *options*, *callback*)
*thisMatch* parameter *thisMatch* parameter
...@@ -133,6 +141,42 @@ With a string, replace any variables within. Uses dotSyntax. Example: ...@@ -133,6 +141,42 @@ With a string, replace any variables within. Uses dotSyntax. Example:
stringVariableReplacement("This card is called $title. It has an attack power of $atk and a health of $health.") stringVariableReplacement("This card is called $title. It has an attack power of $atk and a health of $health.")
``` ```
#### effectSelectCard() #### effectSelectCard(callback)
*callback* parameter
`function (selectedCards)`
| key | description | type |
| ------ | ------ | ------ |
| ciid | The ciid of the card you're executing. | int |
| effectIndex | The index of the effect you're executing on the target card. | int |
#### dulstError(*errorMessage*)
*errorMessage* parameter
| key | description | type |
| ------ | ------ | ------ |
| errorMessage | Some text explaining the error. | string |
#### thisMatch.getRandom()
Dulst safe random generator. Never use your own random.
Returns float like `Math.random()`
#### thisMatch.sample(*population*, *n*)
Dulst safe random sampling. Never use your own random sample.
Returns array.
*population* parameter
Array of possible choices.
*n* parameter
Number of elements to return.
Returns all possible choices based on the target
\ No newline at end of file
Clone repository
  • AI Config
  • Achievements
  • Advanced Effect Building
  • Animal Kingdom
  • Animated Cards
  • Card Rarity
  • Copying Cards and Effects
  • Custom Action
  • Custom Actions
  • Dedicated Servers
  • Editing Cards
  • Effect Building
    • Basic Effect Building
    • Effect Triggers
  • Game Development Service
  • Game Making
    • Beginning Game Customization
View All Pages