Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
loeasy68
GitHub Repository: loeasy68/loeasy68.github.io
Path: blob/main/website/GAUSS/js/action-manager.js
2941 views
1
var Action = function(id)
2
{
3
this.id = id;
4
this.description = '';
5
};
6
7
Action.prototype.setDescription = function(desc)
8
{
9
this.description = desc;
10
};
11
12
var editorActionsList = new Array();
13
var editorMapIdAction = {};
14
var editorActionsCount = 0;
15
16
var createNewEditorAction = function(id, desc)
17
{
18
var newAction = new Action(id);
19
if(desc)
20
newAction.setDescription(desc);
21
editorActionsList.push(newAction);
22
editorMapIdAction[newAction.id] = newAction;
23
};
24
25
var WALK_TO_ID = 'Walk_to';
26
var EYES_ID = 'Eyes';
27
var HAND_ID = 'Hand';
28
var MOUTH_ID = 'Mouth';
29
var COMBINE_ID = 'Combine';
30
31
var DEFAULT_WALK_TO_SENTENCE = 'Walk to';
32
var DEFAULT_EYES_SENTENCE = 'Look at';
33
var DEFAULT_HAND_SENTENCE = 'Pick up';
34
var DEFAULT_MOUTH_SENTENCE = 'Talk to';
35
var DEFAULT_COMBINE_SENTENCE = 'Combine';
36
37
createNewEditorAction(WALK_TO_ID, DEFAULT_WALK_TO_SENTENCE);
38
createNewEditorAction(EYES_ID, DEFAULT_EYES_SENTENCE);
39
createNewEditorAction(HAND_ID, DEFAULT_HAND_SENTENCE);
40
createNewEditorAction(MOUTH_ID, DEFAULT_MOUTH_SENTENCE);
41
createNewEditorAction(COMBINE_ID, DEFAULT_COMBINE_SENTENCE);
42
43
var defaultSentences = {};
44
defaultSentences[HAND_ID] = [ 'I can\'t pick that up.', 'I don\'t need it.', 'That doesn\'t seem to work.', 'I can\'t use that.', 'Nah.'];
45
defaultSentences[EYES_ID] = [ 'I don\'t see anything special about it.', 'Cool.' ];
46
defaultSentences[MOUTH_ID] = [ 'Not a chatterbox.', 'I don\'t think it\'s going to answer.' ];
47
defaultSentences[COMBINE_ID] = [ 'That doesn\'t seem to work.' ];
48
49
var defaultReactions = {};
50
defaultReactions[HAND_ID] = 'var set = defaultSentences["' + HAND_ID + '"]; var idx = Math.floor(Math.random() * set.length); egoSayLine(set[idx])';
51
defaultReactions[EYES_ID] = 'var set = defaultSentences["' + EYES_ID + '"]; var idx = Math.floor(Math.random() * set.length); egoSayLine(set[idx])';
52
defaultReactions[MOUTH_ID] = 'var set = defaultSentences["' + MOUTH_ID + '"]; var idx = Math.floor(Math.random() * set.length); egoSayLine(set[idx])';
53
defaultReactions[COMBINE_ID] = 'var set = defaultSentences["' + COMBINE_ID +'"]; var idx = Math.floor(Math.random() * set.length); egoSayLine(set[idx])';
54
55